Hello all,
I am having trouble trying to delete a row from a custom data type.
As you will see in the code below I add a row to a Table Type (this is done multiple times). I then loop through each row in the table type and pass the id into a separate function. Once this is done I then need to delete that item from the Table Type - this is where i think my syntax is wrong because I get an error "ORA-00903: invalid table name".
Delete code
DELETE FROM TABLE(CAST(l_DeleteList AS TEMP_DOCVERSIONID_TABLE)) WHERE docVersionID = l_DocVersID;
Full Code
l_DeleteList.extend;
l_DeleteList(l_DeleteList.last) := DOCVERSIONID(l_DocVersID);
.......................
select count(*) INTO v_count FROM TABLE(CAST(l_DeleteList AS TEMP_DOCVERSIONID_TABLE));
-- loop temp table and delete document versions
WHILE v_count > 0
LOOP
BEGIN
SELECT docVersionID INTO l_DocVersID FROM TABLE(CAST(l_DeleteList AS TEMP_DOCVERSIONID_TABLE)) WHERE ROWNUM = 1;
DeleteSingleDocumentVersion(l_DocVersID);
DELETE FROM TABLE(CAST(l_DeleteList AS TEMP_DOCVERSIONID_TABLE)) WHERE docVersionID = l_DocVersID;
select count(*) INTO v_count FROM l_DeleteList;
END;
END LOOP;
Thanks in advance,
Toby