Block Variable Visibility
Duration: 10 to 15 minutes.
- Create a block that contains a declaration of a numerical variable named x.
- Retrieve a count of records in the employees table into x.
- Create a inner block with a declaration section where a second numeric variable named x is declared.
- Within the inner block, retrieve a count of records in the departments table into x.
- Display the value of x (containing the count of records in the departments table).
- Within the outer block (following the inner block) display the number of records in the
employees table (retrieved into x in the outer block earlier).
dbms_output.put_line('Departments ' || x);
dbms_output.put_line('Employees ' || x);