PL/SQL Control Statement Exercises: Show the value of a same variable declared as local and global
PL/SQL Control Statement: Exercise-25 with Solution
Write a program in PL/SQL to show the value of a same variable declared as local and global.
<<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; /
When local the value: 1, but the value as global: 6 When local the value: 2, but the value as global: 6 When local the value: 3, but the value as global: 6 When local the value: 4, but the value as global: 6 PL/SQL procedure successfully completed.
Improve this sample solution and post your code through Disqus
What is the difficulty level of this exercise?
- New Content published on w3resource :
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework