Command reference / db

PRTSQLINF

Print SQL Information

The Print Structured Query Language Information (PRTSQLINF) command allows you to print information about the SQL statements in a program, SQL package, service program, or job. The information includes the SQL statements, the access plans used during the running of the statement, and a list of the command parameters which are defined either during the precompile of the source member for the object or when SQL statements are run.

Allowed environments: *ALL. Positional parameters: 2.

Parameters

OBJ Object

Specifies either the name of the object for which you want SQL information printed or *JOB indicating that the job's SQL information is to be printed. A named object can be a program, an SQL package, or a service program.

Type
*QUAL
Required
Yes
Case
Uppercase

Suggested / special values: *JOB

*JOB
The SQL information for the current job is to be printed. The output will only contain information for statements which have been dynamically prepared for the job. It will not contain information for SQL statements in programs, service programs, or SQL packages used by the job.
Qualifier 1: Object: name
Specify the name of the program or SQL package for which you want information printed.
Qualifier 2: Library: name
Specify the name of the library to be searched.
*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Object Object

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

OBJTYPE Object type

Specifies the object type of the object specified for the Object (OBJ) parameter.

Type
*CHAR
Required
No
Default
*PGM
Length
7
Case
Uppercase

Allowed values: *PGM, *SQLPKG, *SRVPGM

*PGM
The object is a program.
*SQLPKG
The object is an SQL package.
*SRVPGM
The object is a service program.

Examples

PRTSQLINF PAYROLL

Printing SQL Information. This command will print information about the SQL statements contained in program PAYROLL.

IBM command documentation

Generated from os/cl/catalog/PRTSQLINF.json and os/cl/help/PRTSQLINF.json.