begin insert into pm1.g1 (e1, e2) select ?, ?; select rowcount; end;
Anonymous procedure block
You can execute a procedure language block as a user command. This can be an advantage in situations in which a virtual procedure does not exist, but a set of processes can be carried out on the server side. For more information about the language for defining virtual procedures, see Procedure language.
-
You can use
in
parameters with prepared/callable statement parameters, as shown in the preceding example, which uses?
parameter. -
You cannot use
out
parameters in an anonymous procedure block. As a workaround, you can use session variables as needed. -
Anonymous procedure blocks do not return data as output parameters.
-
A single result is returned if any of the statements returns a result set. All returnable result sets must have a matching number of columns and types. To indicate that a statement is not intended to provide a result set, use the WITHOUT RETURN clause.