jdt
April 30th, 2004, 06:47 PM
Hi
I have a nested table of REF's that I want to populate inside another table. So I was thinking to create a table "inline" and populate that first (like in the code bit attached) and then just update my attribute that is a nested table (of REF's).
However I get this error when I move a REF into the next element of a table of REF's. I'm new to this so obviously there is a stupid mistake somewhere... :sick:
Or teach me how to print a REF with the DBMS_OUTPUT.PUT_LINE please. That is to print the variable the REF is contained in and not by doing "select ref(c) from ....."
14/5 PL/SQL: Statement ignored
14/48 PLS-00382: expression is of wrong type
CREATE OR REPLACE PROCEDURE temp_INS IS
TYPE Ref_Tab IS TABLE OF REF O_myObject;
lv_Ref_Tab Ref_Tab;
CURSOR C_Part_Cur (in_ID NUMBER) IS
SELECT REF(cp) FROM T_myObject cp
WHERE cp.ID IN (SELECT rp.COMPARTID
FROM SOME_Tabel rp
WHERE rp.ID = in_ID);
BEGIN
FOR lv_myObject in C_Part_Cur (1) LOOP
lv_Ref_Tab.EXTEND;
lv_Ref_Tab(lv_Ref_Tab.LAST) := lv_myObject;
END LOOP;
END;
Thanks
I have a nested table of REF's that I want to populate inside another table. So I was thinking to create a table "inline" and populate that first (like in the code bit attached) and then just update my attribute that is a nested table (of REF's).
However I get this error when I move a REF into the next element of a table of REF's. I'm new to this so obviously there is a stupid mistake somewhere... :sick:
Or teach me how to print a REF with the DBMS_OUTPUT.PUT_LINE please. That is to print the variable the REF is contained in and not by doing "select ref(c) from ....."
14/5 PL/SQL: Statement ignored
14/48 PLS-00382: expression is of wrong type
CREATE OR REPLACE PROCEDURE temp_INS IS
TYPE Ref_Tab IS TABLE OF REF O_myObject;
lv_Ref_Tab Ref_Tab;
CURSOR C_Part_Cur (in_ID NUMBER) IS
SELECT REF(cp) FROM T_myObject cp
WHERE cp.ID IN (SELECT rp.COMPARTID
FROM SOME_Tabel rp
WHERE rp.ID = in_ID);
BEGIN
FOR lv_myObject in C_Part_Cur (1) LOOP
lv_Ref_Tab.EXTEND;
lv_Ref_Tab(lv_Ref_Tab.LAST) := lv_myObject;
END LOOP;
END;
Thanks