Question: ( Marks: 1 4 ) Question 5 Consider the following PL / SQL query: SET ServerOutputs on DECLARING doctor _ name varchar 2 ( 5

(Marks: 14)
Question 5
Consider the following PL/SQL query:
SET ServerOutputs on
DECLARING
doctor_name varchar2(50);
CURSER c1 IS SELECT d.firstname 1|''| d.surname DOCTOR
FROM doctor d, medicine m, prescription p
where d.doctorid =p.doctorid
and m.medid =p.medid
and p.quantity =1;
BEGIN
OPEN C1;
LOOP
FETCH cur1 INTO doctor_name;
EXIT WHEN 1% NOTFOUND;
dbms_output.put_line('DOCTOR: '+d_name );
END;
END;
Q.5.1 The code above has seven (7) errors. Identify the errors and rewrite the code so
(14)
that it would produce a valid output.
 (Marks: 14) Question 5 Consider the following PL/SQL query: SET ServerOutputs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!