Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateContext variables → GDSCODE
Firebird Home Firebird Home Prev: DELETINGFirebird Documentation IndexUp: Context variablesNext: INSERTING

GDSCODE

Available in: PSQL

Added in: 1.5

Changed in: 2.0

Description: In a WHEN GDSCODE handling block, the GDSCODE context variable contains a numerical representation of the current Firebird error code. Starting with Firebird 2.0, the same is true in a WHEN ANY block if its execution was triggered by a Firebird error; otherwise it contains 0. GDSCODE is also 0 in WHEN SQLCODE and WHEN EXCEPTION handlers, as well as everywhere else in PSQL.

Type: INTEGER

Example: 

when gdscode 335544551, gdscode 335544552,
     gdscode 335544553, gdscode 335544707
do
begin
  execute procedure log_grant_error(gdscode);
  exit;
end
Prev: DELETINGFirebird Documentation IndexUp: Context variablesNext: INSERTING
Firebird Documentation IndexFirebird 2.0 Language Ref. UpdateContext variables → GDSCODE