Firebird Documentation IndexFirebird 3.0.2 Release NotesProcedural SQL (PSQL) → PSQL Cursor Stabilization
Firebird Home Firebird Home Prev: CONTINUE in Looping LogicFirebird Documentation IndexUp: Procedural SQL (PSQL)Next: Extension of Colon Prefix Usage

PSQL Cursor Stabilization

Vlad Khorsun

PSQL cursors without SUSPEND inside are now stable:

FOR SELECT ID FROM T WHERE VAL IS NULL INTO :ID
  DO BEGIN
    UPDATE T SET VAL = 1
     WHERE ID = :ID;
  END
    

Previously, this block would loop interminably. Now, the loop will not select the value if it was set within the loop.

Note

This could change the behaviour of legacy code.

If there is a SUSPEND inside the block, the old instability remains: this query, for example, still produces the infinite loop:

FOR SELECT ID FROM T INTO :ID
  DO BEGIN
    INSERT INTO T (ID) VALUES (:ID);
    SUSPEND;
  END
    
Prev: CONTINUE in Looping LogicFirebird Documentation IndexUp: Procedural SQL (PSQL)Next: Extension of Colon Prefix Usage
Firebird Documentation IndexFirebird 3.0.2 Release NotesProcedural SQL (PSQL) → PSQL Cursor Stabilization