Subject | Re: [firebird-support] Firebird 4 and RDB$ERROR |
---|---|
Author | Helen Borrie |
Post date | 2019-05-15T22:24:06Z |
Steve Bailey wrote:
procedural SQL, the language for writing stored procedures, triggers
and executable blocks. And it's about the exception-handling block in
PSQL - meaning you will get null if you try to access it from a part
of your PSQL code that is not an exception handling block. Logically,
that's because the current exception is visible only within the EH
block and, of course, only if an exception actually occurred that
threw execution into the EH block.
Nowhere does it suggest that you could expect anything by trying to
use the function in DSQL.
Helen
---
This email has been checked for viruses by AVG.
https://www.avg.com
> I am using Firebird 4.0 Beta 1.So - off-topic in Firebird Support. But, anyway...
> The release notes describe a new system function RDB$ERROR:Yes. You read that text in the chapter entitled 'PSQL'. That's
> "The function RDB$ERROR() takes a PSQL error context as input and
> returns the specific context of the active
> exception. Its scope is confined to the context of the
> exception-handling block in PSQL. Outside the exception
> handling block, RDB$ERROR always returns NULL"
> To test this in iSQL I have tried: select rdb$error(gdscode) from rdb$database
> This results in:
> Statement failed, SQLSTATE = 42000
> Dynamic SQL Error
> -SQL error code = -104
> -Token unknown
> -GDSCODE
> I was expecting NULL to be returned. Have I misunderstood?
>
procedural SQL, the language for writing stored procedures, triggers
and executable blocks. And it's about the exception-handling block in
PSQL - meaning you will get null if you try to access it from a part
of your PSQL code that is not an exception handling block. Logically,
that's because the current exception is visible only within the EH
block and, of course, only if an exception actually occurred that
threw execution into the EH block.
Nowhere does it suggest that you could expect anything by trying to
use the function in DSQL.
Helen
---
This email has been checked for viruses by AVG.
https://www.avg.com