Question: Using Oracle SQL/plus Database is HR Set echo on SET SERVEROUT ON Set up a spool file to receive your output for submission. I would
Using Oracle SQL/plus
Database is HR
- Set echo on
- SET SERVEROUT ON
- Set up a spool file to receive your output for submission. I would suggest c:\CS4210\wa5spool.txt .
- DECLARE a record variable (Emp_rec) using %ROWTYPE
- In the BEGIN block add a select statement to read a record into the declared variable from HR.EMPLOYEES
- for all employees WHERE DEPARTMENT_ID = 30
- Add a LOOP to print all the records
- Add DBMS_OUTPUT lines to print EMPLOYEE_ID, FIRST_NAME, LAST_NAME, and SALARY for the selected record
- Use TO_CHAR to format the salary as $999,999
- Add a EXCEPTION block to report when no data is found
- Compile and run the procedure.
- Close the spool file
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
