Home » SQL & PL/SQL » SQL & PL/SQL » collections in "in" clause
collections in "in" clause [message #2866] Mon, 19 August 2002 04:19 Go to next message
Gus
Messages: 18
Registered: December 2000
Junior Member
Hi

is it possible to create a function that returns a table of numbers and the use that table as the input for a in clause in a qry.

e.g.

type tbl is table of number(10);

function validstates(inumObjId number) return tbl;

select state_desc
from objstates
where state_id in (validstates(12));

help would be very great

thanks
Re: collections in "in" clause [message #2878 is a reply to message #2866] Mon, 19 August 2002 09:33 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
You can, but you need to use a SQL object type, not a PL/SQL type. See here for the details:

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061
Previous Topic: trigger errors
Next Topic: Find duplicate record help
Goto Forum:
  


Current Time: Wed Apr 24 14:32:37 CDT 2024