Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ESQL-COBOL

The ESQL-COBOL (BS2000) precompiler allows the execution of COBOL programs into which SQL statements have been embedded. This involves marking the start and end of an SQL statement, allowing the precompiler to identify the SQL statements. The precompiler then generates an SQL LLM (link and load module) in which all the SQL statements are grouped together. The COBOL program then contains no more SQL statements and is compiled normally using the COBOL compiler. The following diagram illustrates this process.

Programs with national data types can only be (pre)compiled with the corresponding BS2000 system environment.


Figure 3: Use of the ESQL precompiler


Precompiler options allow the user to define the precompilation attributes. For instance, it is possible to specify that only SQL statements which conform to the standard are permitted, this allowing the generation of portable programs.

The use of dynamic SQL makes it possible to specify SQL statements during execution of an ESQL program. This means that it is possible to implement dialog applications where queries can be structured flexibly and can modify the database.

An ESQL program can also contain CALL DML statements. SQL statements and CALL-DML statements can also be contained together in a transaction. For this purpose, SQL statements are embedded in a CALL DML transaction.

Refer to the “ESQL-COBOL for SESAM/SQL-Server” manual for a detailed description of the ESQL precompiler.

No ESQL-C precompiler is available for SESAM/SQL-Server. We recommend that you extract the SQL statements from a C program and include them in an ESQL COBOL program. The COBOL procedures can then be called from the C program using the SQL statements. The values for SQL host variables are passed to the COBOL procedure in the form of parameters.