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.

DML statements<br />

COLLATE in variable and parameter declarations<br />

Changed in: <strong>2.1</strong><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 />

execute block<br />

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

returns<br />

(nl_1 varchar(20) character set iso8859_1 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 />

execute block (a int not null = ?, b int not null = ?)<br />

returns (product bigint not null, message varchar(20) not null)<br />

as<br />

declare useless_dummy timestamp not null;<br />

begin<br />

product = a*b;<br />

if (product < 0) then message = 'This is below zero.';<br />

else if (product > 0) then message = 'This is above zero.';<br />

else message = 'This must be zero.';<br />

suspend;<br />

end<br />

Domains instead of datatypes<br />

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

Description: <strong>Firebird</strong> <strong>2.1</strong> and up allow the use of domains instead of SQL datatypes when declaring input/output<br />

parameters and local variables. With the “TYPE OF” modifier only the domain's type is used, not its NOT NULL<br />

setting, CHECK constraint and/or default value.<br />

61

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

Saved successfully!

Ooh no, something went wrong!