Executing SQL Requests

The EXECUTE statement is used to invoke a prepared request by name.

When it receives an EXECUTE command, the SQL Translator locates the named statement, S, inserts parameter values (if any) into the text of S, reparses S, and, finally, executes S. EXECUTE results in a diagnostic message if:

execute-statement ::= EXECUTE <stmt-name> [USING <parmlist>]
parmlist ::= <literal> [, <literal>]*

Top of page

Example: Invoking a Prepared Request

EXECUTE MY_QUERY USING 30000
EXECUTE NEW_CUST USING "NEWCO", 10247, "BLOGGS"

While SQL imposes a limit of one parameter list per EXECUTE request, the API permits application programs to submit multiple parameter lists per EDAEXECUTE call (see the API Reference manual). This apparent contradiction is easily explained: the API recasts an EDAEXECUTE request with a batch of parameter lists into a batch of EXECUTE requests, each having a single parameter list.


iWay Software