Start of change

LIBRARY_INFO table function

The LIBRARY_INFO table function returns a result table that contains information about a specific library.

This information is similar to what is returned by the Retrieve Library Description (QLIRLIBD) API and the Retrieve Library Description (RTVLIBD) command

Authorization: The caller must have *READ authority to the library. The null value is returned for the OBJECT_AUDIT_CREATE column unless the caller has *ALLOBJ or *AUDIT special authority.

Read syntax diagramSkip visual syntax diagram LIBRARY_INFO ( LIBRARY_NAME => library-name,IGNORE_ERRORS => ignore-errors,DETAILED_INFO => detailed-info)
The schema is QSYS2.
library-name
An expression that contains the name of a library.
ignore-errors

A character or graphic string expression that identifies what to do when an error is encountered.

NO
An error is returned.
YES
A warning is returned.
No row is returned when an error is encountered. This is the default.
detailed-info

A character or graphic string expression that indicates which columns should be returned.

LIBRARY_SIZE
All the columns including the LIBRARY_SIZE column are returned. For a library with a large number of objects, LIBRARY_SIZE can be a time consuming calculation. This is the default.
NO
Null is returned for the LIBRARY_SIZE column.

The result of the function is a table containing one row with the format shown in the following table. All the columns are nullable.

Table 1. LIBRARY_INFO table function
Column Name Data Type Description
OBJECT_COUNT INTEGER The total number of external objects in the specified library. The count includes objects to which you may not be authorized.
LIBRARY_SIZE BIGINT The size of the library, in bytes, which includes the size of the objects in the library plus the size of the library object itself. This value will be a rounded value for a library larger than 1 000 000 000 bytes.

Contains the null value if detailed-info is NO.

LIBRARY_SIZE_COMPLETE VARCHAR(3) Whether LIBRARY_SIZE includes all objects in the library.
NO
Some objects in the library were omitted because they were locked, or the user does not have any authority to the object.
YES
The size of all the objects in the library was used in determining the total library size.

Contains the null value if detailed-info is NO.

LIBRARY_TYPE CHAR(4) The library type.
PROD
The library is a production library. Database files in production libraries cannot be opened for updating if a user, while in debug mode, requested that production libraries be protected.
TEST
The library is a test library. All objects in a test library can be updated during a test. See the Start Debug (STRDBG) command in the on-line help for more details.
TEXT_DESCRIPTION VARCHAR(50) The user-defined text that briefly describes the library and its function.

Contains the null value if the library has no descriptive text.

IASP_NAME VARCHAR(10) The auxiliary storage pool (ASP) device name where the library is stored. If the library is in the system ASP or one of the basic user ASPs, contains *SYSBAS.

Contains the null value if the name of the ASP device cannot be determined.

IASP_NUMBER INTEGER The number of the auxiliary storage pool (ASP) from which the system allocates storage for the library.
CREATE_AUTHORITY VARCHAR(10) The default public authority for an object created into the library. This is the authority given to a user who does not have specific authority to the object, who is not on an authorization list specified for the object, and whose user groups have no specific authority to the object. When you create an object into the library, the AUT parameter on the create command for the object determines the public authority for the object. If the AUT value on the create command for the object is *LIBCRTAUT, which is the default, the public authority for the object is set to the CRTAUT value for the library.
*ALL
The user can perform all authorized operations on an object created in this library.
*CHANGE
The user can read the object description and has read, add, update, and delete authority to an object created in this library.
*EXCLUDE
The user is prevented from accessing an object created in this library.
*SYSVAL
The default authority for an object created in this library is determined by the value specified by the QCRTAUT system value.
*USE
The user can read the object and its description but cannot change them for an object created in this library.
Authorization list name
The name of the authorization list that secures an object created in this library. The default public authority is taken from the authorization list, and the public authority for the object is specified as *AUTL.
OBJECT_AUDIT_CREATE VARCHAR(7) The auditing value for objects created in this library.
*ALL
All change or read access to the object is logged.
*CHANGE
All change access to the object by all users is logged.
*NONE
Use or change access to the object is not logged (no audit entry is sent to the security journal).
*SYSVAL
The value specified in the system value QCRTOBJAUD is used.
*USRPRF
The user profile of the user who accesses the object is used to determine if an audit record is sent for this access. The OBJAUD parameter of the Change User Auditing (CHGUSRAUD) command is used to turn auditing on for a specific user.

Contains the null value if caller does not have either all object (*ALLOBJ) or audit (*AUDIT) special authority.

JOURNALED VARCHAR(3) Identifies the current journaling status of the library.
NO
The library is not currently journaled.
YES
The library is currently journaled.
JOURNAL_LIBRARY VARCHAR(10) The name of the library that contains the journal that receives the journaled changes to the library, if the library is currently journaled. If the library was previously journaled but is not currently journaled, contains the name of the library that contains the last journal to which the library was journaled.

Contains the null value if journaling has never been started for this library.

JOURNAL_NAME VARCHAR(10) The name of the journal that receives the journaled changes to the library, if the library is currently journaled. If the library was previously journaled but is not currently journaled, contains the name of the last journal to which the library was journaled.

Contains the null value if journaling has never been started for this library.

INHERIT_JOURNALING VARCHAR(3) Identifies whether new journal-eligible objects created into, moved into, or restored into this library should inherit journaling from the library according to the journal inherit rules.
NO
The new journal-eligible objects will not inherit journaling from the library.
YES
The new journal-eligible objects will inherit journaling from the library according to the journal inherit rules.
JOURNAL_INHERIT_RULES INTEGER The number of inherit rules defined for this library. The rules can be listed using the QSYS2.JOURNAL_INHERIT_RULES view.
JOURNAL_START_TIMESTAMP TIMESTAMP The timestamp journaling was last started for this library.

Contains the null value if journaling has never been started for this library.

APPLY_STARTING_RECEIVER_LIBRARY VARCHAR(10) Specifies the library name of the oldest journal receiver needed to successfully use the Apply Journaled Changes (APYJRNCHG) command.

Contains the null value if the object has not been journaled or it has not been saved and restored since journaling was started.

APPLY_STARTING_RECEIVER VARCHAR(10) Specifies the name of the oldest journal receiver needed to successfully use the Apply Journaled Changes (APYJRNCHG) command.

Contains the null value if the object has not been journaled or it has not been saved and restored since journaling was started.

APPLY_STARTING_RECEIVER_ASP VARCHAR(10) The auxiliary storage pool (ASP) device name where APPLY_STARTING_RECEIVER is stored. If APPLY_STARTING_RECEIVER is in the system ASP or one of the basic user ASPs, contains *SYSBAS.

Contains the null value if the name of the ASP device cannot be determined.

Example

  • Retrieve information about library APPLIB.
    SELECT * FROM TABLE(QSYS2.LIBRARY_INFO('APPLIB'));
End of change