The syntax for the execute statement is:
exec sql [at connection] execute statement_name
[into host_var_list | sql descriptor
descriptor_name | descriptor sqlda_name]
[using host_var_list | sql descriptor
descriptor_name | descriptor sqlda_name];
where:
statement_name is the name assigned in the prepare statement.
into is used for a single-row select.
using specifies the C variables or descriptors substituted for a dynamic parameter marker in host_variable. The variables, which you must define in a declare section, are substituted in the order listed. You need only this clause when the statement contains dynamic parameter markers.
descriptor_name represents the area of memory that holds a description of the dynamic SQL statement’s dynamic parameter markers.
host_var_list a list of host variables to substitute into the parameter markers (“?”) in the query.
sqlda_name is the name of the SQLDA.