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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PSQL statements<br />

exception ex_bad_type 'Wrong type for record with id ' || new.id;<br />

Note<br />

Starting at version 2.0, the maximum message length is 1021 instead of 78 characters.<br />

Available in: DSQL, PSQL<br />

Changed in: 1.5<br />

EXECUTE PROCEDURE<br />

Description: In <strong>Firebird</strong> 1.5 and above, (compound) expressions are allowed as input parameters for stored<br />

procedures called with EXECUTE PROCEDURE. See DML statements :: EXECUTE PROCEDURE for full info<br />

and examples.<br />

Available in: PSQL<br />

Added in: 1.5<br />

EXECUTE STATEMENT<br />

Description: EXECUTE STATEMENT takes a single string argument and executes it as if it had been submitted as<br />

a DSQL statement. The exact syntax depends on the number of data rows that the supplied statement may return.<br />

No data returned<br />

This form is used with INSERT, UPDATE, DELETE and EXECUTE PROCEDURE statements that return no data.<br />

Syntax:<br />

Example:<br />

EXECUTE STATEMENT <br />

::= An SQL statement returning no data.<br />

create procedure DynamicSampleOne (ProcName varchar(100))<br />

as<br />

declare variable stmt varchar(1024);<br />

declare variable param int;<br />

begin<br />

select min(SomeField) from SomeTable into param;<br />

stmt = 'execute procedure '<br />

|| ProcName<br />

|| '('<br />

|| cast(param as varchar(20))<br />

101

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

Saved successfully!

Ooh no, something went wrong!