Please enable JavaScript to view this site.

ESL Documentation

subroutine
Batch Command (ORACLE and ODBC Only)
Transfer buffered rows and with ORACLE terminates batch mode.

aexec 

Description

The aexec command executes the astmt statement for any aval statements that remain after the last batch transfer, then, if used with ORACLE terminates batch mode. With ODBC batches can only comprise of a single row, so aexec must be used after each aval command. Batch mode is terminated, if the command following an aexec is not an aval command.

Example

subroutine ProcessSQLCommand(string: Command_SV) is

 begin guarded

         response to start

                 send Command_SV to SQL

         response to "SQL>"

                 leave block

 end

 

response to BeginORACLEInsert 

 copy "asize 10\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "astmt insert into emp (ename, enum) values (:x, :y)\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval JONES, 9000\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval SMITH, 8500\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 

response to BeginODBCInsert 

 copy "astmt insert into emp (ename, enum) values (?, ?)\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval JONES, 9000\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval SMITH, 8500\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)