SYSPACKSTMT catalog table
The SYSPACKSTMT table contains one or more rows for each SQL statement in a package that is bound locally, and one or more rows for a subset of the SQL statements in a package that is bound remotely. The schema is SYSIBM.
Column name | Data type | Description | Use |
---|---|---|---|
LOCATION |
VARCHAR(128)
NOT NULL |
Always contains blanks | S |
COLLID |
VARCHAR(128)
NOT NULL |
Name of the package collection. | G |
NAME |
VARCHAR(128)
NOT NULL |
Name of the package. | G |
CONTOKEN |
CHAR(8)
NOT NULL FOR BIT DATA |
Consistency token for the package. This is either:
|
S |
SEQNO |
INTEGER
NOT NULL |
Sequence number of the statement. Rows that contain zero in the SEQNO, STMTNO, and SECTNO column values are for IBM internal use only. |
G |
STMTNO |
SMALLINT
NOT NULL |
The statement number of the statement in the source program. If the STMTNO value is zero, the statement number is greater 32767 and the STMTNOI column contains the statement number. A negative value indicates a statement number greater than 32767 in a DRBM created in DB2 version 2.2 or earlier. To convert a negative value to a meaningful statement number, add 65536 to the negative STMTNO value. For example, -26472 is equivalent to +39064 ( Rows that contain zero in the SEQNO, STMTNO, and SECTNO column values are for IBM internal use only. |
G |
SECTNO |
SMALLINT
NOT NULL |
The section number of the statement. For generated packages for SQL routines, such as procedures and user-defined functions, and advanced triggers, a value of 1 indicates the control statement for the routine or advanced trigger. For basic trigger packages, a value of 1 indicates the WHEN clause for activating the trigger. Rows that contain zero in the SEQNO, STMTNO, and SECTNO column values are for IBM internal use only. |
G |
BINDERROR |
CHAR(1)
NOT NULL |
Whether an SQL error was detected at bind time:
|
G |
IBMREQD |
CHAR(1)
NOT NULL |
A value of Y indicates that the row was provided with the Db2 product code. For all other values, see Release dependency indicators. The value in this field is not a reliable indicator of release dependencies. |
G |
VERSION |
VARCHAR(122)
NOT NULL |
Version identifier for the package. | G |
— |
VARCHAR(3500)
NOT NULL WITH DEFAULT FOR BIT DATA |
Internal use only. | I |
ISOLATION |
CHAR(1)
NOT NULL WITH DEFAULT |
Isolation level for the SQL statement:
|
G |
STATUS |
CHAR(1)
NOT NULL WITH DEFAULT |
Status of binding the statement:
|
S |
STATUS (cont.) |
|
||
ACCESSPATH |
CHAR(1)
NOT NULL WITH DEFAULT |
For static statements,
indicates if the access path for the statement is based on user-specified optimization hints:
|
G |
STMTNOI |
INTEGER
NOT NULL WITH DEFAULT |
The statement number of the statement in the source program. A negative value indicates a statement number greater than 32767 in a DRBM created in DB2 version 2.2 or earlier. To convert a negative value to a meaningful statement number, add 65536 to the negative STMTNO value. For example, -26472 is equivalent to +39064 ( |
G |
SECTNOI |
INTEGER
NOT NULL WITH DEFAULT |
The section number of the statement. For generated packages for SQL routines, such as procedures and user-defined functions, and advanced triggers, a value of 1 indicates the control statement for the routine or advanced trigger. For basic trigger packages, a value of 1 indicates the WHEN clause for activating the trigger. |
G |
EXPLAINABLE |
CHAR(1)
NOT NULL WITH DEFAULT |
Contains one of the following values:
|
G |
QUERYNO |
INTEGER
NOT NULL WITH DEFAULT –1 |
The query number of the SQL statement in the source program. SQL statements bound prior to Version 7 have a default value of –1. Statements bound in Version 7 or later use the value specified on the QUERYNO clause on SELECT, UPDATE, INSERT, DELETE, EXPLAIN, DECLARE CURSOR, or REFRESH TABLE statements. If the QUERYNO clause is not specified, the query number is set to the statement number. | G |
ROWID |
ROWID
NULL GENERATED ALWAYS |
ROWID column, created for the lob columns in this table. | G |
STMT_ID |
BIGINT
NOT NULL |
A unique statement identifier. | G |
STATEMENT |
CLOB(2M)
NOT NULL WITH DEFAULT |
The complete text for the SQL statement that the row represents. | G |
— |
BLOB(2M)
NOT NULL WITH DEFAULT |
Internal use only. | I |
EXPANSION_REASON |
CHAR(2)
NOT NULL |
For dynamic statements, this column is blank. For static statements, one of the following values to indicate the reason that an implicit query transformation occurred when the package was bound:
|
G |
QUERYID | BIGINT NOT NULL WITH DEFAULT -1 | The unique identifier for locating records in the SYSIBM.SYSQUERY catalog table. The default value is -1 indicates that no QUERYID value was found for the SQL statement when the package was bound. | G |
QUERY_HASH | CHAR(16) NOT NULL WITH DEFAULT FOR BIT DATA | The hash key for locating records in the SYSIBM.SYSQUERY catalog table. This value is not unique for each statement. Other columns for the collection ID, package name, section number, and query number can be used with the hash key for uniqueness. The '00'x default value indicates that no hash key was generated for the SQL statement when the package was bound. |
G |
QUERY_HASH_
VERSION |
INTEGER NOT NULL WITH DEFAULT -1 | The hash version for locating records in the SYSIBM.SYSQUERY catalog table. The -1 default value indicates that no hash version was generated for the SQL statement when the package was bound. | G |
COPYID |
INTEGER
NULLABLE |
The copy ID of the package. | G |