21.10.2013 Views

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

Firebird 2.1 Language Reference Update

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example:<br />

DML statements<br />

execute block (a my_domain = ?, b type of my_other_domain = ?)<br />

returns (p my_third_domain)<br />

as<br />

declare s_temp type of my_third_domain;<br />

begin<br />

...<br />

...<br />

end<br />

Available in: DSQL, ESQL, PSQL<br />

Changed in: 1.5<br />

EXECUTE PROCEDURE<br />

Description: Executes a stored procedure. In <strong>Firebird</strong> 1.0.x as well as in InterBase, any input parameters for the<br />

SP must be supplied as literals, host language variables (in ESQL) or local variables (in PSQL). In <strong>Firebird</strong> 1.5<br />

and above, input parameters may also be (compound) expressions, except in static ESQL.<br />

Syntax:<br />

EXECUTE PROCEDURE procname<br />

[TRANSACTION transaction]<br />

[ [, ...]]<br />

[RETURNING_VALUES [, ...]]<br />

::= []<br />

::= []<br />

::= an expression evaluating to the declared parameter type<br />

::= a host language or PSQL variable to receive the return value<br />

::= [INDICATOR]:host_lang_intvar<br />

Examples:<br />

Notes<br />

• TRANSACTION clauses are not supported in PSQL.<br />

• Expression parameters are not supported in static ESQL, and not in <strong>Firebird</strong> versions below 1.5.<br />

• NULL indicators are only valid in ESQL code. They must be host language variables of type<br />

integer.<br />

• In ESQL, variable names used as parameters or outvars must be preceded by a colon (“:”). In<br />

PSQL the colon is generally optional, but forbidden for the trigger context variables OLD and<br />

NEW.<br />

In PSQL (with optional colons):<br />

execute procedure MakeFullName<br />

:FirstName, :MiddleName, :LastName<br />

returning_values :FullName;<br />

62

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!