5. Working with 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
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.
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 (see DECLARE TABLE).
For details on the dclgen utility, see the Embedded SQL Companion Guide or the Command Reference Guide.