Midrange News for the IBM i Community

Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
SQL iQuery Documentation - UDF and UDTF
has no ratings.
Published: 18 Jun 2019
Revised: 02 Jul 2019 - 1434 days ago
Last viewed on: 05 Jun 2023 (663 views) 
  1. SQL iQuery - RUNiQRY CL Command
  2. CSV() - Read and Parse Comma Separated Values File
  3. CSV_VAL() Extract CSV Column Value
  4. CSV_XXXX() Extract CSV Column Value as xxxx
  5. CSV_COUNT - Retrieve Field Count
  6. ObjExist - Check Object Exits
  7. DTAARA - Data Area
  8. encode_URL Encode URL for the Web
  9. encode_TAG Encode HTML TAG Content
  10. FLDLIST - List the Fields of a Table
  11. FROMHEX - Fold 2-hex Chars into 1 Char
  13. MD5_HASH - UDF - Return MD5 Hash
  14. ifsStat - Get IFS File Attributes
  15. ifsExists - Check if IFS File Exists
  16. ifsFile - Query Contents of IFS Text File
  17. ifsDIR - List IFS Directory Entires
  18. DEPFILE - List Dependent Database Relations
  19. JOB - Get Job Name Component
  20. Job_ATTR - Job Attributes
  21. JOB_DATE Retrieve the Job Date
  22. JOBLOG - Write Message to Joblog
  23. Library List UDF and Procedures
  24. MBRLIST - Member List
  25. MCHINFO Machine Type and Model Number and OS version
  26. OSVER and OSVRM Get IBM i Version/Release
  27. PrintPDF - Print a PDF to a PDF Compatible Printer
  28. CPYTOPDF - Copy SPOOLED File to PDF file
  29. OBJ_LIST List Object in a Library
  30. LIB_LIST List Descriptions of Libraries on the Library List
  31. OBJ_EXPORTS List Exported Items from an Object
  32. OBJ_STRUCT Retrieve Objects Components
  33. RTVCMDD Retrieve Command Definition
  34. RTVJOBA - Retrieve Job Attributes
  35. RTVJOBD - Retrieve Job Description
  36. RTVLASTSPLF - Retrieve ID of Last SPOOLED File for this Job
  37. RTVxxx - Retrieve Various Objects Description Table Functions
  38. WATCHLIST - List Current Watches
  39. Polymorphic Qualified Name Syntax

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.

iQuery.xxxLIBL() - UDF and Procedure Published by: Bob Cozzi on 18 Jun 2019 view comments

Check, Change, or Add To the Library List

The iQuery.xxxLIBL() UDFs and iQuery.xxxLIBL() Stored Procedures allow uses to use SQL to check and change the library list for the job.

Name Type Parameter(s) Description
CHKLIBLE UDF varchar(10) Check the library list for the specified library name. Returns 1 if found, 0 if not found.
ADDLIBLE Proc varchar(3000) Add one or more libraries to the library list. Library names are separated by one or more blanks.
RMVLIBLE Proc varchar(3000) Remove one or more libraries from the library list. Library names are separated by one or more blanks.
CHGLIBL Proc varchar(3000) Replaces the user-portion of the library list with the list of library names (separated by one or more blanks).
CHGCURLIB Proc varchar(10) Changes the Current Library of the library list to the library name specified.

The CHKLIBLE UDF can be used to verify that a library is on the library list before running other SQL statements or CL commands.

The Procedures (ADDLIBLE, RMVLIBLE, CHGLIBL) will modify the user portion of the job's library list. Note that ADDLIBL and RMVLIBL are alternate spellings for the ADDLIBLE and RMVLIBLE procedures, respectively.



SQL iQuery Script Example

if (chklible('SALESHIST') = 0);
call iQuery.addlible('SALESHIST');

RPG IV Example

exec sql values iQuery.chklible('SALESHIST') into :libExists;
if (libExists = 0);
exec SQL call iQuery.addlible('SALESHIST');


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