Print a single formatted record - Set echo on - Set up a spool file to receive your output for submission. I would suggest c:\cs4210\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
Print a single formatted record
- Set echo on
- Set up a spool file to receive your output for submission. I would suggest c:\cs4210\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
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
I got this error when running code:
DBMS_OUTPUT.PUT_LINE('Job Title: ' || Emp_rec.Job_Title);
*
ERROR at line 24:
ORA-06550: line 24, column 49:
PLS-00302: component 'JOB_TITLE' must be declared
ORA-06550: line 24, column 3:
PL/SQL: Statement ignored
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)