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.

Available in: DSQL, PSQL<br />

Added in: 1.0<br />

Context variables<br />

CURRENT_USER<br />

Description: CURRENT_USER is a context variable containing the name of the currently connected user. It is<br />

fully equivalent to USER.<br />

Type: VARCHAR(31)<br />

Example:<br />

create trigger bi_customers for customers before insert as<br />

begin<br />

New.added_by = CURRENT_USER;<br />

New.purchases = 0;<br />

end<br />

Available in: PSQL<br />

Added in: 1.5<br />

DELETING<br />

Description: Available in triggers only, DELETING indicates if the trigger fired because of a DELETE operation.<br />

Intended for use in multi-action triggers.<br />

Type: boolean<br />

Example:<br />

if (deleting) then<br />

begin<br />

insert into Removed_Cars (id, make, model, removed)<br />

values (old.id, old.make, old.model, current_timestamp);<br />

end<br />

Available in: PSQL<br />

Added in: 1.5<br />

Changed in: 2.0<br />

GDSCODE<br />

Description: In a WHEN GDSCODE handling block, the GDSCODE context variable contains a numerical representation<br />

of the current <strong>Firebird</strong> error code. Starting with <strong>Firebird</strong> 2.0, the same is true in a WHEN ANY block if<br />

112

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

Saved successfully!

Ooh no, something went wrong!