Firebird Documentation IndexFirebird 2.5 Release NotesProcedural SQL (PSQL) → Other PSQL Improvements
Firebird Home Firebird Home Prev: New Extensions to EXECUTE STATEMENTFirebird Documentation IndexUp: Procedural SQL (PSQL)Next: International Language Support (INTL)

Other PSQL Improvements

Subqueries as PSQL Expressions
SQLSTATE as Context Variable

Improvements made to existing PSQL syntax include the following:

Subqueries as PSQL Expressions

A. dos Santos Fernandes

Tracker reference CORE-2580

Previously, a subquery used as a PSQL expression would return an exception, even though it was logically valid in SQL terms. For example, the following constructions would all return errors:

var = (select ... from ...);
if ((select ... from ...) = 1) then
if (1 = any (select ... from ...)) then
if (1 in (select ... from ...)) then
      

Now, such potentially valid expressions are allowed, removing the need to jump through hoops to fetch the output of a scalar subquery into an intermediate variable using SELECT...INTO.

SQLSTATE as Context Variable

D. Yemanov

Tracker reference CORE-2890

(v.2.5.1) SQLSTATE is made available as a PSQL context variable, to be used with WHEN in an exception block, like GDSCODE and SQLCODE.

Prev: New Extensions to EXECUTE STATEMENTFirebird Documentation IndexUp: Procedural SQL (PSQL)Next: International Language Support (INTL)
Firebird Documentation IndexFirebird 2.5 Release NotesProcedural SQL (PSQL) → Other PSQL Improvements