Total Pageviews

February 20, 2017

2/20/2017 12:20:00 AM
Oracle PLSQL Name Space
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;
/

 
Related Posts Plugin for WordPress, Blogger...