Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored Procedure and WHERE IN statement.

Re: Stored Procedure and WHERE IN statement.

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Mon, 28 Jun 2004 18:53:56 -0700
Message-ID: <1088474067.921922@yasure>


Tim wrote:

> Hi, I have a stored procedure where I'm trying to pass in the string
> "11761, 13870, 11762, 13053, 12845" of numbers (P_Dept_Id) into a
> WHERE IN statment.
>
> The IN statement treats P_Dept_Id as a string rather than individual
> integers which my goal is. Can somebody tell me what I'm doing wrong
> here?
>
>
> ...
>
> P_Dept_Id IN VARCHAR2,
>
> ...
>
> --Doesn't work
> SELECT Section_Id FROM Section
> WHERE Parent_Id in (P_Dept_Id)
>
> --DOES work
> SELECT Section_Id FROM Section
> WHERE Parent_Id in (11761, 13870, 11762, 13053, 12845)

Follow Michel's advice ... the answer involves using multiset. http://www.psoug.org/reference/cast.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Mon Jun 28 2004 - 20:53:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US