dbTalk Databases Forums  

Using Select .. IN with a IN Parm

comp.database.oracle comp.database.oracle


Discuss Using Select .. IN with a IN Parm in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Scott
 
Posts: n/a

Default Using Select .. IN with a IN Parm - 02-21-2005 , 08:59 PM






How can I use a varchar2 IN parameter in an IN clause in PLSQL??

i.e.
v_parms IN varchar2 (v_parms would look like
('scott','dave','mike') )

Begin

Select * from table
where table_field in v_parms;

End

Do I have to use a DBMS_SQL.Open .. DBMS_SQL.Parse sequence??

Thanks
SW



Reply With Quote
  #2  
Old   
Jim Kennedy
 
Posts: n/a

Default Re: Using Select .. IN with a IN Parm - 02-22-2005 , 09:47 PM







"Scott" <scott.wilson19 (AT) comcast (DOT) net> wrote

Quote:
How can I use a varchar2 IN parameter in an IN clause in PLSQL??

i.e.
v_parms IN varchar2 (v_parms would look like
('scott','dave','mike') )

Begin

Select * from table
where table_field in v_parms;

End

Do I have to use a DBMS_SQL.Open .. DBMS_SQL.Parse sequence??

Thanks
SW


No, you need to write a function that converts the comma delimited list to a
pl/sql table and do a cast to table. see asktom.oracle.com
Jim




Reply With Quote
  #3  
Old   
Scott
 
Posts: n/a

Default Re: Using Select .. IN with a IN Parm - 02-22-2005 , 10:03 PM



Thanks Jim,

I will research CAST and see what it can do.

Much Appreciated.
SW

"Jim Kennedy" <kennedy-downwithspammersfamily (AT) attbi (DOT) net> wrote

Quote:
"Scott" <scott.wilson19 (AT) comcast (DOT) net> wrote in message
news:6ZadnbFGANl7AoffRVn-ig (AT) comcast (DOT) com...
How can I use a varchar2 IN parameter in an IN clause in PLSQL??

i.e.
v_parms IN varchar2 (v_parms would look like
('scott','dave','mike') )

Begin

Select * from table
where table_field in v_parms;

End

Do I have to use a DBMS_SQL.Open .. DBMS_SQL.Parse sequence??

Thanks
SW


No, you need to write a function that converts the comma delimited list to
a
pl/sql table and do a cast to table. see asktom.oracle.com
Jim





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.