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 -> Input array string

Input array string

From: Cowboy <gbworld_at_hotmail.com>
Date: 23 Jan 2004 12:57:53 -0800
Message-ID: <488e40ee.0401231257.41f90a51@posting.google.com>


I have a .NET app that pulls a group of values from a listbox. I need to have that list in a WHERE IN clause:

SELECT * FROM TABLE1
WHERE Column1 IN {PASSED IN VALUES}

Not sure how to do this in Oracle. I do know the following.

  1. I cannot pass in an array or a table type as a parameter, as I am stuck with the Microsoft Oracle Client provider and not the Oracle downloadable provider. Input will have to be something like a comma-separated string as VARCHAR.
  2. I know how to create a TABLE TYPE and fill it with a loop, so I can create the TABLE TYPE in the sproc and utilize it, if that is the answer.
  3. I had to prove to the other developer that this does not work:

CREATE PROCEDURE MyProc
(

    IN_STRING VARCHAR2,
    OUT_CUR Types.cursor_type
)
AS

BEGIN
  SELECT * FROM TABLE1
  WHERE Column1 IN IN_STRING ; -- Invalid numeric error END; NOTE: REF_CURSOR is fairly normal for output to .NET in our environ.

I also have tried

WHERE IN TableTypeNameHere

WHERE IN (SELECT * FROM TableTypeNameHere)

I know how I would solve this in SQL Server, but I am lost with the proper Oracle implementation, other than to embed a dynamic SQL query in the app (not my choice) or create a temp table (an option, but would prefer something that can use an array or TABLE TYPE in the WHERE IN clause).

TIA, Gregory A. Beamer Received on Fri Jan 23 2004 - 14:57:53 CST

Original text of this message

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