How to query oracle table type variables?
914600Feb 2 2012 — edited Feb 2 2012Hello All,
I have one table type variable declared on my oracle package specs like below.
TYPE line_id IS TABLE OF T1.line_id%TYPE
INDEX BY BINARY_INTEGER;
now I'm assigning values to this table type in my SP by declaring a variable of this table type.
line_ids line_id; -- line_ids is the variable of the table type line_id
now depending upon the data present in line_ids I need to run a delete statement from a table like below.
DELETE FROM T2 WHERE line_id in
(SELECT line_id from table of line_ids)-- Here I'm getting error
I know I can loop through this table type and get the values, but I wanted to know if there is any other way like may be sub queries to achieve the same. Any help would be highly appreciated. Thanks in advance.
Regards,
Subhadeep