Question: Evaluate the following PL/SQL block: DECLARE CURSOR c_1 IS SELECT col_1, col_3 FROM tab1 ORDER BY c1; v_rec c_1%ROWTYPE; BEGIN OPEN c_1; LOOP FETCH c_1

Evaluate the following PL/SQL block:

DECLARE

CURSOR c_1 IS

SELECT col_1, col_3

FROM tab1

ORDER BY c1;

v_rec c_1%ROWTYPE;

BEGIN

OPEN c_1;

LOOP

FETCH c_1 INTO v_rec;

EXIT WHEN v_rec.col_1 >= 100 OR

v_rec.col_1 <= -50 OR

c_1%NOTFOUND;

......

DBMS_OUTPUT.PUT_LINE(v_rec%ROWCOUNT);

DBMS_OUTPUT.PUT_LINE(v_rec.col_3);

......

END LOOP;

CLOSE c_1;

END;

Why will the above block cause a syntax error?

A. The DBMS_OUTPUT.PUT_LINE(v_rec.col_3)statement is illegal.

B. The DBMS_OUTPUT.PUT_LINE(v_rec%ROWCOUNT)statement is illegal.

C. The EXIT-WHEN statement is illegal.

D. The FETCH statement is illegal.

E. The %ROWTYPE attribute can only be used in reference to actual tables.

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!