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

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

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

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Header Files
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage