5. Embedded OpenSQL : Host Language Variables : The Dclgen Utility--Generate Structure
 
Share this page                  
The Dclgen Utility--Generate Structure
The dclgen (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. Invoke dclgen from the operating system level with the following command:
DCLGEN language dbname tablename filename structurename
where:
language
Specifies the host language (for example, “C”).
dbname
Specifies the name of the database containing the table.
tablename
Specifies the name of the database table.
filename
Names the output file generated by dclgen that contains the structure declaration.
structurename
Specifies the name of the generated host language structure.
Dclgen creates the declaration file, filename, containing a structure corresponding to the database table. The file also includes a DECLARE TABLE statement that identifies the database table and columns from which the structure was generated. After the file has been generated, an embedded OpenSQL INCLUDE statement can be used to incorporate the file into the variable declaration section.
For details on the dclgen utility, see the Embedded SQL Companion Guide.