Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
Polymorphic Qualified Name Syntax
© Bob Cozzi, Jr. has no ratings.
Published: 10 Sep 2019
Revised: 10 Sep 2019 - 1682 days ago
Last viewed on: 18 Apr 2024 (1288 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

PQN - Polymorphic Qualfiied Name Published by: Bob Cozzi on 10 Sep 2019 view comments
© Bob Cozzi, Jr.

QPN - Polymorphic Qualified Name Syntax

Some SQL iQuery Functions support our polymorphic qualified name (PQN) syntax. This syntax allows users to specify the object name using two separate parameters, one parameter or one qualified parameter. Polymorphic qualified name syntax supports these syntaxes for object names:

  • 'library','object'
  • 'object'
  • 'library/object'

Our Functions typically have 2 parameters for object names:

  1. Library or Schema name
  2. Object or Table name

With PQN syntax, users can omit the 2nd parameter and include the fully qualified object name as the first parameter. For example:

iQuery.myFunc('qgpl','qrpglesrc')

and

iQuery.myFunc('qgpl/qrpglesrc')

These two variations produce the same results. Two separate parameters, or one parameter with both values.

In addition, if only the object name is specified, for example:

iQuery.myFunc('qrpglesrc')

Then the default value for the library or schema is used. Often this is *LIBL, but can be *CURLIB or some other documented value--see the UDTF's documentation for the specific default.

 

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS