To use DB/2, you must have IBM DB/2, version 8.1 or higher. You should have a general knowledge of DB/2, and the corresponding SQL implementation.
DB/2 must be running before this program is started. Before you can access any DB/2 database with the SQL Executable, you must ensure that the database contains an access package for this application. The access package is created by a procedure called binding. The bind procedure can be executed by using the DB/2 command "bind", along with the ESLSQLDB.BND file delivered with ESL, or it can be executed directly via the binddb command.
After an access package is created, you must have access package execution privileges to execute the package. To grant execution privileges, you need to know the NAME of the access plan. The name of the access plan which results from binding ESLSQLDB.BND is called ESL.SQLMAIN. Use the IBM DB/2 Control Center to grant the execute privileges, to the required Users, and/or Groups.
The following section summarizes the essential steps you need to follow when binding IBM's Database Manager software to the ESL SQL Executable.
1. Bind the ESL local program to each database to which it connects.
Binding provides information to a database about the existence of another program - in this case, the ESL local program (ESLSQLDB.EXE). ESL provides a bind file (ESLSQLDB.BND) to help you do this. Note that the SQL Executable always looks for ESLSQLDB.BND, so do not change the name of this file.
There are two ways to accomplish this:
a)From an ESL application, use the bindfile command to specify the location of the ESLSQLDB.BND file.
Then issue the binddb command to bind to the database. Note that you must issue a binddb command for each database you want to access. However, once you bind to a database, you do not need to issue binddb again to that same database even if you run a different ESL application or shut down the current application and start over. Therefore, do not place binddb and bindfile commands in a response to start action block. (Note, however, that if your application accesses another database, you must rebind to the original database before attempting to access it again.)
The only exception to this is when you reconfigure the database or receive a new version of the SQL Executable from ESL Syndetic Ltd. that requires you to issue and new binddb command. Such a situation is indicated if an attempt to access the database results in a message that indicates a timestamp conflict (see Section 2.2).
b)Because both bindfile and binddb require System or Database Administrator privileges, binding from an ESL application may not be appropriate.
In such a case, the Database Administrator must issue an BIND command using the DB/2 command line interpreter or DB/2 Control Center. Please refer to the DB/2 documentation for complete information on use of this command.
The result of the bind is called an Access Package.
Note: The SQL Support application uses DB/2 isolation level Cursor Stability. To override this, use the bind command to bind the application to the database with the required isolation level.
2. Grant each User or Group appropriate access rights for each Access Package.
DB/2 requires that the Database Administrator must explicitly grant each user authority for each SQL statement that the user may execute. In addition, it requires that each user must also have execute privilege for each Access Package that the user may require.
This means that, to use ESLSQLDB.EXE, each user must have execute privilege for the Access Package that results from the bind operation. To do this, the Database Administrator must issue a DB/2 statement similar to one of the following:
•grant execute on package esl.sqlmain to USER FRED
•grant execute on package esl.sqlmain to USER GUEST
Note: In order for the startdb, stopdb, and all dynamic SQL commands to succeed, DB/2 must be running.
Databases are always started in DB/2 shared mode.