Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored Procedure and WHERE IN statement.
"Tim" <enloet_at_hotmail.com> a écrit dans le message de
news:995d0f2.0406280925.59de48ec_at_posting.google.com...
> 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)
I just write "where in" group:comp.databases.oracle.* in Google search box and get 925 hits from which about 10% answer your question.
I just type something as foolish as "where in (list)" on Tom Kyte site (http://asktom.oracle.com) and get your answer.
So...
Regards
Michel Cadot
Received on Mon Jun 28 2004 - 13:50:34 CDT