I am really struggling with this in SQL. I keep getting errors. Would it be possible to also attach a spool file for this? I would like to see a spool file for this exercise. I'm very confused. Print a single formatted record Set echo on Set up a spool file. I would suggest c:\Folder\WA4spool.txt SET SERVEROUTPUT ON DECLARE a record variable (Emp_rec) using %ROWTYPE In the BEGIN block use INTO to load a record into the declared variables for HR.EMPLOYEES for Employee_ID = 114 Use a CASE statement to print the associated Department Name for Department_ID Add DBMS_OUTPUT lines to print each variable for the selected record Use TO_CHAR to format Salary as 999,999.00 Add an EXCEPTION block to report when no data is found Compile and run the procedure Close the spool file
I am really struggling with this in SQL. I keep getting errors. Would it be possible to also attach a spool file for this? I would like to see a spool file for this exercise. I'm very confused.
Print a single formatted record
Set echo on
Set up a spool file. I would suggest c:\Folder\WA4spool.txt
SET SERVEROUTPUT ON
DECLARE a record variable (Emp_rec) using %ROWTYPE
In the BEGIN block use INTO to load a record into the declared variables for HR.EMPLOYEES for Employee_ID = 114
Use a CASE statement to print the associated Department Name for Department_ID
Add DBMS_OUTPUT lines to print each variable for the selected record
Use TO_CHAR to format Salary as 999,999.00
Add an EXCEPTION block to report when no data is found
Compile and run the procedure
Close the spool file
Step by step
Solved in 5 steps with 1 images