Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I am getting error

3414431Mar 17 2017 — edited Mar 17 2017

DECLARE

TYPE EmpRecd

IS RECORD(V_Emp Emp%ROWTYPE);

V_EmpRecd EmpRecd;

TYPE EmpTbl

IS TABLE OF V_EmpRecd%TYPE;

V_EmpTbl EmpTbl;

TYPE EmpRef

IS REF CURSOR

RETURN EmpRecd;

V_EmpRef EmpRef;

BEGIN

OPEN V_EmpRef

FOR SELECT * FROM Emp;

FETCH V_EmpRef BULK COLLECT INTO V_EmpTbl;

CLOSE V_EmpRef;

FOR Ind IN V_EmpTbl.FIRST..V_EmpTbl.LAST

LOOP

DBMS_OUTPUT.PUT_LINE(V_EmpTbl(Ind).Empno||','||V_EmpTbl(Ind).Ename);

END LOOP;

END;

If we are taking only some columns from a table in record type its working but if we are taking %ROWTYPE its not working.Can anyone please help me out from this

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2017
Added on Mar 17 2017
3 comments
272 views