Variable scope in variable 'declare' block : Variable Scope « PL SQL « Oracle PL / SQL






Variable scope in variable 'declare' block

 
SQL>
SQL>
SQL> -- variable scope
SQL>
SQL>  declare
  2      l_number number := l_another_number;
  3      l_another_number number := 10;
  4    begin
  5      null;
  6    end;
  7    /
    l_number number := l_another_number;
                       *
ERROR at line 2:
ORA-06550: line 2, column 24:
PLS-00320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 2, column 14:
PL/SQL: Item ignored



           
         
  








Related examples in the same category

1.Illustrates the scope of various identifiers
2.Variable scope in a PL/SQL
3.Identifiers defined in the declaration of the child block are only in scope and visible within the child block itself.
4.if you try to reference a variable before you declare it because PL/SQL requires an identifier be declared before we use it in our code
5.This type is local to this block
6.Reference Type in another block as well
7.variable scope with nested block
8.Override your scope access to containing blocks by reusing an identifier in a nested block