I tried the following query but getting the error:
Please hint me to solve the error.
CODE
DECLARE
TYPE TYP_DUP1 IS TABLE OF DUP1%ROWTYPE;
V_DUP1 TYP_DUP1;
BEGIN
SELECT A
BULK COLLECT INTO V_DUP1
FROM DUP1;
FOR I IN V_DUP1.FIRST.. V_DUP1.LAST LOOP
DBMS_OUTPUT.PUT_LINE(V_DUP1(I).A);
END LOOP;
END;
/
TYPE TYP_DUP1 IS TABLE OF DUP1%ROWTYPE;
V_DUP1 TYP_DUP1;
BEGIN
SELECT A
BULK COLLECT INTO V_DUP1
FROM DUP1;
FOR I IN V_DUP1.FIRST.. V_DUP1.LAST LOOP
DBMS_OUTPUT.PUT_LINE(V_DUP1(I).A);
END LOOP;
END;
/
But getting the following error:
************************
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 6
*************************