3. Embedded SQL for COBOL : Preprocessor Operation : The COBOL Compiler—VMS : How Embedded SQL Programs are Linked
 
Share this page                  
How Embedded SQL Programs are Linked
Embedded SQL programs require procedures from several VMS shared libraries in order to run properly. Once you have preprocessed and compiled an embedded SQL program, you can link it. Assuming the object file for your program is called dbentry, use the following link command:
link dbentry.obj,-
ii_system:[ingres.files]esql.opt/opt
Link Precompiled Forms
The technique of declaring a precompiled form to the FRS is discussed in the SQL Reference Guide and in the COBOL Data Items and Data Types section in this chapter. To use such a form in your program, you must also follow the steps described here.
To link a precompiled form
1. In VIFRED, select a menu item to compile a form. VIFRED then creates a file in your directory describing the form in the VAX‑11 MACRO language. Select a name for the file.
2. Once you have created the MACRO file, assemble it into linkable object code with the VMS command:
macro filename
3. The output of this command is a file with the extension .obj. Link this object file with your program by listing it in the link command, as shown in the following example, which links the form defined in the file empform:
link formentry,-
 empform.obj,-
 ii_system:[ingres.files]esql.opt/opt