Class PlsqlBlockScope

Object
gudusoft.gsqlparser.resolver2.scope.AbstractScope
gudusoft.gsqlparser.resolver2.scope.PlsqlBlockScope
All Implemented Interfaces:
IScope

public class PlsqlBlockScope extends AbstractScope
Scope for PL/SQL blocks (Oracle, PostgreSQL PL/pgSQL).

PL/SQL blocks can have labels (<>) that allow referencing variables declared within the block using the label as a qualifier:

 <<main>>
 DECLARE
   ename VARCHAR2(10) := 'KING';
 BEGIN
   DELETE FROM emp WHERE ename = main.ename;  -- main.ename references the block variable
 END;
 

This scope:

  • Contains a PlsqlVariableNamespace for declared variables
  • Uses the block label as the namespace alias
  • Allows name resolution to distinguish block variables from table columns