SQL Language Guide : 5. Embedded SQL : Host Language Variables in Embedded SQL : Dclgen Utility--Generate Structure
 
Share this page                  
Dclgen Utility--Generate Structure
The dclgen utility (declaration generator utility) is a structure‑generating utility that maps the columns of a database table into a structure that can be included in a variable declaration.
The dclgen utility can be invoked from the operating system level by executing the following command:
DCLGEN language dbname tablename filename structurename [-n] [-q]
language
Defines the embedded SQL host language.
dbname
Defines the name of the database containing the table.
tablename
Defines the name of the database table.
filename
Defines the output file generated by dclgen containing the structure declaration.
structurename
Defines the name of the generated host language structure.
-n
Does not print the DECLARE TABLE statement.
This command creates the declaration file, filename, containing a structure corresponding to the database table. The file also includes a DECLARE TABLE statement that serves as a comment and identifies the database table and columns from which the structure was generated. Once the file has been generated, use an embedded SQL INCLUDE statement to incorporate it into the variable declaration section. For details, see DECLARE TABLE.
For details on the dclgen utility, see the Command Reference in the User Guide.