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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Csv list variable passed to stored proc

Re: Csv list variable passed to stored proc

From: <Jared.Still_at_radisys.com>
Date: Mon, 07 Oct 2002 10:49:05 -0800
Message-ID: <F001.004E29AE.20021007104905@fatcity.com>


Bob,

Yes, but you must use dynamic SQL, via either EXECUTE IMMEDIATE or the DBMS_SQL package.

Another alternative, stuff the values you want check into a temporary table,
use the temp table for you IN clause. Much easier.

Jared

"Bob Metelsky" <bmetelsky_at_cps92.com>
Sent by: root_at_fatcity.com
 10/07/2002 09:53 AM
 Please respond to ORACLE-L  

        To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
        cc: 
        Subject:        Csv list variable passed to stored proc


List

                 Is it possible to pass a comma seperated list of 
variables to
make up a portion of the in clause in a stored procedure

I have a list of variables IdList that looks like this (1,2,3,4,5,66,77,88,someothernumbers)

    PROCEDURE MyProc
    (

        IdList IN VARCHAR
        SelectCursor OUT SelectRefCursor
    )

   IS
 BEGIN
OPEN SelectCursor FOR

 SELECT          * 
 FROM            MyTable
WHERE           ID IN ( IdList );

EXCEPTION       WHEN OTHERS THEN
...

   END MyProc;

thanks
bob
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Bob Metelsky
  INET: bmetelsky_at_cps92.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: Jared.Still_at_radisys.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Oct 07 2002 - 13:49:05 CDT

Original text of this message

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