Oracle PLSQL: Global Name Space :OUTER
Following example showing a difference between inner block and outer block variable scope.
You can use OUTER keyword to access outer block variable inside the inner block.
It's called global qualified name space.
Example Code:
DECLARE
num number := 10;
BEGIN
DECLARE
num number := 10;
BEGIN
IF num = OUTER.num THEN
DBMS_OUTPUT.PUT_LINE('Both are same value');
ELSE
DBMS_OUTPUT.PUT_LINE('Different value');
END IF;
END; -- End of scope to access num variable
END;
/
Following example showing a difference between inner block and outer block variable scope.
You can use OUTER keyword to access outer block variable inside the inner block.
It's called global qualified name space.
Example Code:
DECLARE
num number := 10;
BEGIN
DECLARE
num number := 10;
BEGIN
IF num = OUTER.num THEN
DBMS_OUTPUT.PUT_LINE('Both are same value');
ELSE
DBMS_OUTPUT.PUT_LINE('Different value');
END IF;
END; -- End of scope to access num variable
END;
/