DESCRIBE FOR STATIC field (DESCSTAT subsystem parameter)

The DESCSTAT subsystem parameter specifies whether Db2 builds a SQL descriptor area (SQLDA) when binding static SQL statements. This SQLDA is where Db2 returns names of result table columns for a DESCRIBE CURSOR statement.

The DESCSTAT subsystem parameter provides the default value for the DESCSTAT BIND or REBIND option. The DESCSTAT BIND or REBIND option value always overrides the DESCSTAT subsystem parameter value.

Normally, a DESCRIBE request cannot be issued against a static SQL statement, with the following exceptions:

  • In a distributed environment, where Db2 for z/OS® is the server, and the requester supports extended dynamic SQL. In this scenario, a DESCRIBE request that is executed on an SQL statement in the extended dynamic package appears to Db2 as a DESCRIBE on a static SQL statement in the Db2 package.
  • When an application uses a stored procedure result set, and the application must allocate a cursor for that result set. The application can describe that cursor by using a DESCRIBE CURSOR statement. The SQL statement that is actually described is the one for which the cursor is declared in the stored procedure. If that statement is static, this requires that a static SQL statement must be described.
Acceptable values: NO or YES
Default: YES
Update: option 28 on panel DSNTIPB
DSNZPxxx: DSN6SPRM DESCSTAT
NO
Db2 does not generate a DESCRIBE SQLDA at bind time for static SQL statements. If a DESCRIBE request is received at execution time, Db2 generates an error. However, if the describe request comes from a DESCRIBE CURSOR statement, Db2 satisfies the request but is able to provide only data type and length information. Column names are not provided.
YES
Specifies that Db2 builds a SQL descriptor area (SQLDA) when binding static SQL statements, so that it can return names of result table columns for a DESCRIBE CURSOR statement. Specifying YES increases the size of some packages because the DESCRIBE SQLDA is now stored with each statically bound SQL SELECT statement.

YES is the default value.

If your Db2 for z/OS subsystem or Db2 for Linux®, UNIX, and Windows systems use the IBM® Data Server Driver for JDBC and SQLJ, or if your Db2 for Linux, UNIX, and Windows systems use the CLI driver, you must set the DESCSTAT parameter to YES.