Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Oracle 11g Sql Plus Working with Case Statement 1. Set echo on 2. SET SERVEROUT ON 3. Set up a spool file to receive

Using Oracle 11g Sql Plus

Working with Case Statement

1. Set echo on

2. SET SERVEROUT ON

3. Set up a spool file to receive your output for submission. I would suggest c:\CS4210\wa4spool.txt .

4. DECLARE a record variable (Emp_rec) using %ROWTYPE

5. In the BEGIN block add a select statement to read a record into the declared variable from HR.EMPLOYEES for an Employee_ID to be determined at run time

6. Add DBMS_OUTPUT lines to print DEPARTMENT, EMPLOYEE_ID, FIRST_NAME, LAST_NAME, and SALARY for the selected record

7. Use a CASE statement to print the associated Department Name for DEPARTMENT_ID

8. Use TO_CHAR to format the salary as $999,999

9. Add a EXCEPTION block to report when no data is found

10. Compile and run the procedure for the Employee, 114

11. Close the spool file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

ISBN: 1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

8. Explain the difference between translation and interpretation.

Answered: 1 week ago

Question

10. Discuss the complexities of language policies.

Answered: 1 week ago

Question

1. Understand how verbal and nonverbal communication differ.

Answered: 1 week ago