Please enable JavaScript to view this site.

ESL Documentation

Batch Command (ORACLE and ODBC Only)
Provide data values for use with an SQL statement.

aval VALUES_CLAUSE 

VALUES_CLAUSE 

A list of the values you want placed into one row by the most recent astmt command.

Description

Use this command to provide data values for use with a SQL statement previously specified in an astmt command. Separate values in the values list with commas. For ODBC, it is possible to include embedded commas by enclosing the value with single or double quotes. As a single quote does not need an escape sequence, we recommend you use this options unless the field also could contain an embedded single quote.

Each value passed must be acceptable to the field to which it relates, so for example a small integer field can only contain up to 6 characters (5 digits plus the sign). If there are not sufficient fields defined in the aval statement, then the value from the previous aval statement will be used, or the field will default to a null string, if no aval statement has defined a value. If too many fields a defined in an aval statement, then an error message "ERROR: Too many column items" will be returned and batch mode will be terminated.

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 KIRK, 9003\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval LAFORGE, 9008\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval MCCOY, 9004\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval PICARD, 9006\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval RIKER, 9007\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval SCOTT, 9002\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

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

 copy "aval SULU, 9001\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval TROI, 9009\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval UHURA, 9005\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 (:x, :y)\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval KIRK, 9003\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval LAFORGE, 9008\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval MCCOY, 9004\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval PICARD, 9006\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval RIKER, 9007\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval SCOTT, 9002\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

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

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval SULU, 9001\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval TROI, 9009\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aval UHURA, 9005\n" to SQLCommand_ASV
 call ProcessSQLCommand(SQLCommand_ASV)

 copy "aexec\n" to SQLCommand_ASV

 call ProcessSQLCommand(SQLCommand_ASV)