Please enable JavaScript to view this site.

ESL Documentation

Direct Command (DB/2 Only)
Disconnect from a current database, bind to and connect to a new one.

binddb DATABASE 

DATABASE

A string value representing the name of the database.

Description

This command disconnects from the currently running database(s); runs the DB/2 dynamic bind routine; and connects to the new database.

The ESL local SQL application must be linked once to each database that it will access through a procedure called binding. The bind process creates a DB/2 access package for the application, which is required before any SQL statements can be processed successfully. An access package contains information that DB/2 uses to process data requests.

The binddb command allows the ESL program to direct the local application to bind to the database at runtime. This is very useful when the ESL application does not know the target database name at compile time.

Since running the bind procedure requires special privileges, however, binding at runtime may be inappropriate. (Issuing a binddb command requires BIND privileges.) If this is the case, the bind command provided with DB/2 can be used.

The binddb command requires a bind file called ESLSQLDB.BND, which is supplied with ESL.

If an attempt is made to execute SQL statements from this application on a database to which this application is not bound, a -818 error code results (a timestamp conflict occurred).

After an access package is created, you must have access plan execution privileges in order to execute the access package. To grant execution privileges, you need to know the NAME of the access package (see the IBM DB/2 Reference Guide for grant statement, program privileges, details). The name of the access plan which results from binding ESLSQLDB.BND is called esl.sqlmain.

See the DB/2 Programming Guide and Reference for more information on access package maintenance and bind procedures.

ORACLE Only

This command is equivalent to startdb.

SQL Server Only

This performs the same function as the TRANSACT-SQL use command.

Example

response to start 

   start local SQL "eslsqldb" 

   send "bindfile c:\\Program Files\\ESLSysdetic\n" to SQL 

   send "binddb sample\n" to SQL