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.

DDL statements<br />

Description: <strong>Firebird</strong> <strong>2.1</strong> and up allow COLLATE clauses in declarations of input/output parameters and local<br />

variables.<br />

Example:<br />

create procedure SpanishToDutch<br />

(es_1 varchar(20) character set iso8859_1 collate es_es,<br />

es_2 my_char_domain collate es_es)<br />

returns<br />

(nl_1 varchar(20) character set iso8859_1 collate du_nl,<br />

nl_2 my_char_domain collate du_nl)<br />

as<br />

declare s_temp varchar(100) character set utf8 collate unicode;<br />

begin<br />

...<br />

...<br />

end<br />

NOT NULL in variable and parameter declarations<br />

Changed in: <strong>2.1</strong><br />

Description: <strong>Firebird</strong> <strong>2.1</strong> and up allow NOT NULL constraints in declarations of input/output parameters and<br />

local variables.<br />

Example:<br />

create procedure RegisterOrder(order_no int not null, description varchar(200) not null)<br />

returns<br />

(ticket_no int not null)<br />

as<br />

declare temp int not null;<br />

begin<br />

...<br />

...<br />

end<br />

Default argument values<br />

Changed in: 2.0<br />

Description: It is now possible to provide default values for stored procedure arguments, allowing the caller to<br />

omit one or more items (possibly even all) from the end of the argument list.<br />

Syntax:<br />

CREATE PROCEDURE procname ( [, ...])<br />

...<br />

::= paramname datatype [{= | DEFAULT} value]<br />

Important: If you provide a default value for a parameter, you must do the same for any and all<br />

parameters following it.<br />

31

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

Saved successfully!

Ooh no, something went wrong!