BIND

Enables deployment of application code by generating an SQL batch script that can be used with sqlcmd or SQL Server Management Studio to update the SQL Server database. Compiled OpenESQL code issues a call to SQL Server stored procedures, contained in the SQL batch script.

Syntax:

Note: Applies to SQL Server only.
BIND=bind-script-file

Parameters:

bind-script-file
The name of the bind file.

Properties:

Default: BIND=prog-name

Where prog-name is the COBOL program name.

Dependencies:

When you use BIND, to ensure that your application works, the SQL batch script created must be executed against your SQL Server database.

Scope:

Used at compile time: Yes
Behavior at run time: Source file

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Advantages:

  • Security can be applied separately to procedures and data so that application users can only access and update data via the application.
  • DBAs can review SQL that is to be deployed without having to access source code.

Comments:

The filename extension for generated bind script files is .sql. For example, if you specify BIND=myprog, the generated bind script file name is myprog.sql.

To update the SQL Server database, run the generated bind script file using sqlcmd or from SQL Server Management Studio.

The generated bind script file contains commands to create a separate stored procedure in the schema specified by your SQL Server connection for each static SQL statement in the program.

If stored procedures from a previous compilation are present in the schema, OpenESQL drops them before creating new stored procedures.