Subject | Fw: Exceptions; context_variables |
---|---|
Author | Arcadio Ortega |
Post date | 2004-10-25T06:53:29Z |
Readme.context_variables :
SQLCODE / GDSCODE (FB 1.5)
--------------------------
Function:
Returns numeric error code for the active exception.
Author:
Dmitry Yemanov <yemanov@...>
Syntax rules:
SQLCODE / GDSCODE
Type:
INTEGER
Scope:
PSQL, context of the exception handling block.
Example(s):
BEGIN
...
WHEN SQLCODE -802 THEN
EXCEPTION E_EXCEPTION_1;
WHEN SQLCODE -803 THEN
EXCEPTION E_EXCEPTION_2;
WHEN ANY DO
EXECUTE PROCEDURE P_ANY_EXCEPTION(SQLCODE);
END
Note(s):
1. GDSCODE variable returns a numeric representation of the
appropriate Firebird error code.
2. Both SQLCODE and GDSCODE always evaluate to zero outside
the exception handling block.
3. If you catch exceptions with 'WHEN SQLCODE' block, then only
SQLCODE variable contains the error code inside this block,
whilst GDSCODE contains zero. Obviously, this situation is
opposite for 'WHEN GDSCODE' block.
4. For 'WHEN ANY' block, the error code is set in SQLCODE
variable only.
-------¿
5. If user-defined exception is thrown, both SQLCODE and GDSCODE
variables contain zero, regardless of the exception handling
block type.
any variable contain this exception?
thank you
-------?
[Non-text portions of this message have been removed]
SQLCODE / GDSCODE (FB 1.5)
--------------------------
Function:
Returns numeric error code for the active exception.
Author:
Dmitry Yemanov <yemanov@...>
Syntax rules:
SQLCODE / GDSCODE
Type:
INTEGER
Scope:
PSQL, context of the exception handling block.
Example(s):
BEGIN
...
WHEN SQLCODE -802 THEN
EXCEPTION E_EXCEPTION_1;
WHEN SQLCODE -803 THEN
EXCEPTION E_EXCEPTION_2;
WHEN ANY DO
EXECUTE PROCEDURE P_ANY_EXCEPTION(SQLCODE);
END
Note(s):
1. GDSCODE variable returns a numeric representation of the
appropriate Firebird error code.
2. Both SQLCODE and GDSCODE always evaluate to zero outside
the exception handling block.
3. If you catch exceptions with 'WHEN SQLCODE' block, then only
SQLCODE variable contains the error code inside this block,
whilst GDSCODE contains zero. Obviously, this situation is
opposite for 'WHEN GDSCODE' block.
4. For 'WHEN ANY' block, the error code is set in SQLCODE
variable only.
-------¿
5. If user-defined exception is thrown, both SQLCODE and GDSCODE
variables contain zero, regardless of the exception handling
block type.
any variable contain this exception?
thank you
-------?
[Non-text portions of this message have been removed]