PRTSQLINF (Print Structured Query Language Information) Command Description
PRTSQLINF Command syntax diagram
Purpose
The Print Structured Query Language Information (PRTSQLINF) command prints 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 used to precompile the source member for the object or when SQL statements are run.
Required Parameters
- OBJ
- 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.
The name of the object can be qualified by one of the following library values:
*LIBL: All libraries in the job's library list 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.
library-name: Specify the name of the library to be searched.
object-name: Specify the name of the program, SQL package, or service program for which you want information printed.
*JOB: Indicates that 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.
Optional Parameters
- OBJTYPE
- Specifies the type of object.
*PGM: The object is a program.
*SQLPKG: The object is an SQL package.
*SRVPGM: The object is a service program.
Example for PRTSQLINF
Example 1: Printing SQL Information
PRTSQLINF PAYROLLThis command will print information about the SQL statements contained in program PAYROLL.
Error messages for PRTSQLINF
*ESCAPE Messages
- SQL9011
- Print of SQL information failed.