As at 3 in Figure 3-1, in most application programs you embed the CONNECT command
to start a DBE session in a program:
EXEC SQL CONNECT TO 'PartsDBE';
|
If autostart mode is ON at run time, this command starts a
DBE session. If autostart mode is OFF, a DBA
must issue a START DBE command before the program can
be executed. Regardless of the autostart mode in effect, the
program user must have CONNECT and RUN authority for this
command to execute.
You can embed the START DBE command in a program to start a DBE
session if the owner of the program has DBA authority. However, only one copy
of the program can be executed at a time, by a user with DBA authority.
For single-user DBEnvironments, this constraint poses no problem.
In a multiuser environment, however, once a DBEnvironment is started, only the CONNECT command
can be used to initiate additional DBE sessions.
Place the DBE session initiation command in an executable section of your program such that
it executes at run time before all other SQL commands except the WHENEVER command.