Any input not recognized as a direct, configuration, or inquiry command is taken to be an SQL command, and is executed as such. If the SQL command is a statement that returns result rows, the results are returned to ESL. The statement size limit is 32K.
The ESL compiler only handles string literals that contain less than 255 characters. Therefore, to send a longer statement to the SQL Executable, separate the statement into sections and send them (without a command terminator) to the SQL Executable until the statement is complete. Alternately, copy or append the statement sections to a temporary variable, then send the variable to the SQL Executable; for example:
copy "select " to Temp_SV
append "* from " to Temp_SV
append Table_SV to Temp_SV
append Terminator_SV to Temp_SV
send Temp_SV to SQL
Use the SQL command "select count (*) from ..." to determine the number of records that will be in the results table for a given query.