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 -> Convert comma delimited numbers to numbers in SQL IN query

Convert comma delimited numbers to numbers in SQL IN query

From: vinod_agarwal <vinodagarwal_at_gmail.com>
Date: 25 May 2006 08:27:45 -0700
Message-ID: <1148570865.576018.212580@j33g2000cwa.googlegroups.com>


Hi
I have a qurey like this in a stored procedure. SELECT field1, field2 from myTable1 WHERE tablePk IN (100, 200, 300, 400);

In above query the number of values in IN clause are not known when the procedure is invoked from JDBC. Hence the stored procedure takes a VARCHAR2 parameter with all the values in a comma delimited form. E.g.: "100, 200, 300, 400").

Howevever I cannot do something like this: SELECT field1, field2 from myTable1 WHERE tablePk IN (myStoreProcParam);

because the param myStoreProcParam is of type VARCHAR2, whereas the tablePk is of type NUMBER.

How do I solve this problem? Received on Thu May 25 2006 - 10:27:45 CDT

Original text of this message

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