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 />

Notes:<br />

Restrictions<br />

DML statements<br />

• No column may appear more than once in the update/insert column list.<br />

• If the table has no PK, the MATCHING clause becomes mandatory.<br />

• The “INTO ” subclause is only available in PSQL.<br />

• When values are returned into the context variable NEW, this name must not be preceded by<br />

a colon (“:”).<br />

update or insert into Cows (Name, Number, Location)<br />

values ('Suzy Creamcheese', 3278823, 'Green Pastures')<br />

matching (Number)<br />

returning rec_id into :id;<br />

• Matches are determined with IS NOT DISTINCT, not with the “=” operator. This means that one NULL matches<br />

another.<br />

• The optional RETURNING clause:<br />

- ...may contain any or all columns of the target table, regardless if they were mentioned earlier in the<br />

statement, but also other expressions.<br />

- ...may contain OLD and NEW qualifiers for field names; by default, the new field value is returned.<br />

- ...returns field values as they are after the BEFORE triggers have run, but before any AFTER triggers.<br />

88

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

Saved successfully!

Ooh no, something went wrong!