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!

How to query oracle table type variables?

914600Feb 2 2012 — edited Feb 2 2012
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2012
Added on Feb 2 2012
2 comments
1,557 views