Q:

Write a program in PL/SQL to show the value of a same variable declared as local and global

0

Write a program in PL/SQL to show the value of a same variable declared as local and global.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<<main_label>>
DECLARE
  n NUMBER := 6;
BEGIN
  FOR n IN 1..4 LOOP
    DBMS_OUTPUT.PUT_LINE (
      'When local the value: ' || TO_CHAR(n) || ', but the value as global: ' ||
      TO_CHAR(main_label.n)  
    );
  END LOOP;
END main_label;
/

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now