Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Based on the code below... What are the other ways you can run though all the data to display the entire result set? Provide the

Based on the code below...

  1. What are the other ways you can run though all the data to display the entire result set?
  2. Provide the syntax for the alternative approach to retrieve the same result.

DECLARE

CURSOR CUR_EMPLOYEE_DETAILS

AS

SELECT E.EMPLOYEE_ID AS EMPLOYEE_ID,

E.FIRST_NAME || || E.LAST_NAME AS EMPLOYEE_NAME,

E.JOB_ID AS JOB_ID,

J.JOB_TITLE AS JOB_TITLE,

J.MIN_SALARY AS MINIMUM_SALARY,

J.MAX_SALARY AS MAXIMUM_SALARY

FROM EMPLOYEES E, JOBS J

WHERE E.JOB_ID = J.JOB_ID;

RV_EMPLOYEE_DETAILS CUR_EMPLOYEE_DETAILS%ROWTYPE;

BEGIN

OPEN CUR_EMPLOYEE_DETAILS;

LOOP

FETCH CUR_EMPLOYEE_DETAILS INTO RV_EMPLOYEE_DETAILS ;

DBMS_OUTPUT.PUT_LINE(Employee ID: ||

rv_employee_details.employee_id);

Complete the remaining display of employees data based on the join statement.

EXIT WHEN CUR_EMPLOYEE_DETAILS%NOTFOUND;

END LOOP;

CLOSE CUR_EMPLOYEE_DETAILS;

EXCEPTION

WHEN NO_DATA_FOUND THEN

DBMS_OUTPUT.PUT_LINE(No data found);

END;

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Please make it fast 3 5 1 .

Answered: 1 week ago

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago