Tricky DB2 question on DCLGEN

Tip to find Primary key in DB2
Tip to find Primary key in DB2

When using DCLGEN to generate a table declaration, which information concerning this table is NOT available in the generated output?

(a) The null indicators of the columns/fields.

(b) The primary key of the table.

(c) The datatypes of columns/fields.

(d) The data structures specific to the programming language.

Reason: DCLGEN produces output that is intended to meet the needs of most users, but occasionally, you need to edit the DCLGEN output to work in your specific case. For example, DCLGEN is unable to determine whether a column that is defined as NOT NULL also contains the DEFAULT clause, so you must edit the DCLGEN output to add the DEFAULT clause to the appropriate column definitions.

Sample DCLGEN output:

DCLGEN TABLE(VEMPL) -
 LIBRARY('prefix.SRCLIB.DATA(DSN8MPEM)') -
 LANGUAGE(PLI) -
 APOST
The output looks like this:

/*********************************************************************/
/* DCLGEN TABLE(VEMPL) - */
/* LIBRARY('prefix.SRCLIB.DATA(DSN8MPEM)') - */
/* LANGUAGE(PLI) - */
/* APOST */
/* ... IS THE DCLGEN COMMAND THAT MADE THE FOLLOWING STATEMENTS */
/*********************************************************************/
EXEC SQL DECLARE VEMPL TABLE
 ( EMPNO CHAR(6) NOT NULL,
 FIRSTNME VARCHAR(12) NOT NULL,
 MIDINIT CHAR(1) NOT NULL,
 LASTNAME VARCHAR(15) NOT NULL,
 WORKDEPT CHAR(3) NOT NULL
 ) ;
/*********************************************************************/
/* PLI DECLARATION FOR TABLE VEMPL */
/*********************************************************************/
DCL 1 DCLVEMPL,
 5 EMPNO CHAR(6),
 5 FIRSTNME CHAR(12) VAR,
 5 MIDINIT CHAR(1),
 5 LASTNAME CHAR(15) VAR,
 5 WORKDEPT CHAR(3);
/*********************************************************************/
/* THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 5 */
/*********************************************************************/
Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.