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.
The iQuery.lib_list() UDTF returns one row for each library on the library list. Unlike the LIBRARY_LIST_INFO view in the QSYS2 library, this UDTF returns object-related information along with the library list library names.
iQuery.lib_List( )
This UDTF has no parameters.
Column | Type | Description |
LLSEQ | smallint | The sequence the library appears on the library. UDTF do not return ordered lists in the order specified. Therefore to return the library list in the proper sequence, specify ORDER BY LLSEQ on the SELECT statement. |
OBJNAME | varchar(10) | The name of the library. |
LLTYPE | varchar(15) | The library list type where the libary occurs. USER, SYSTEM, PRODUCT or CURRENT |
OBJATTR | varchar(10) | The Object Attribute. For Libraries, this column is either: PROD or TEST |
OBJTEXT | varchar(50) | The text description of the library. |
OBJOWNER | varchar(10) | The library owner. |
OBJCREATOR | varchar(10) | The user profile of the user who created the library. |
CRTDATE | DATE | The Library Creation Date. |
CRTTIME | TIME | The Library Creation Time |
CRTSYSNAME | varchar(10) | The system on which the library was created. |
DAMAGED | varchar(10) | Damed Object Attribute: *DAMAGED, *PARTIAL or blank. |
ASP | smallint | The ASP where the library exists. |
DOMAIN | varchar(10) | The domain where the library exists (system or user domain) |
CRTVRM | varchar(9) | The version of IBM i on which the object was created. The format is VxRyMz |
CHGDATE | DATE | The Last Changed Date of the object. |
CHGTIME | TIME | The Last Changed Time of the object. |
LASTSAVEDDATE | DATE | Last Date when a save of the object occurred. |
LASTSAVEDTIME | TIME | Last Time a save of the object occurred. |
LASTRESTOREDDATE | DATE | The date when the object was last restored. |
LASTRESTOREDTIME | TIME | Last Time the object was restored. |
LASTUSEDDATE | DATE | The date when the object was last used. |
LASTUSEDTIME | TIME | The time on the last used date when the object was used (often not specified) |
DAYSUSED | INT | The number of days the object has been used. |
The following creates a list of all objects in library COZTOOLS and includes the creation date and last used date.
select * from table(iQuery.lib_list()) ll ORDER BY llSeq;
An excerpt from the resultSet generated by the above statement follows:
LLSEQ OBJNAME LLTYPE OBJATTR OBJTEXT OBJOWNER OBJCREATOR 1 QSYS SYSTEM PROD System Library QSYS *IBM 2 QSYS2 SYSTEM PROD System Library for CPI's QSYS *IBM 3 QHLPSYS SYSTEM PROD QSYS QLPINSTALL 4 QUSRSYS SYSTEM PROD System Library for Users QSYS *IBM 5 IQUERY PRODUCT TEST QPGMR COZZI 6 COZTOOLS CURRENT TEST Cozzi APPTOOLS - Developer Tools QPGMR COZZI 7 COZTOOLS USER TEST Cozzi APPTOOLS - Developer Tools QPGMR COZZI 8 COZDEV USER TEST COZTOOLS Development Source Library COZZI COZZI 9 QGPL USER PROD General Purpose Library QSYS *IBM 10 QTEMP USER TEST QSYS QSYS 11 SENDMAIL USER TEST Example of using Java Sendmail from RPG IV QPGMR COZZI