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

Home -> Community -> Usenet -> comp.databases.oracle -> Re: A simple newbie question with select

Re: A simple newbie question with select

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Thu, 8 Jan 2004 12:03:07 -0500
Message-ID: <TJ6dnRq5xOTSEGCi4p2dnA@comcast.com>

"Tomislav Petrovic" <t.petrovic_at_inet.hr> wrote in message news:btk1n4$gna$1_at_garrison.globalnet.hr...
| Or in other words:
|
| How can I write this query inside stored procedure
|
| SELECT local_id, remote_id FROM SYNCML_MAPS WHERE idn_id = a_db_idn AND
| local_id IN (1, 3, 9, 17, 20001);
|
| So that (1, 3, 9, 17, 20001) part can be specified as procedure input
| parameter???
|
| Tomy.
|
|

try constructing the statement and using EXECUTE IMMEDIATE (probably the preferred method)

if the predicate on the LOCAL_ID column does not contribute to performance (i.e., plenty of selectivity on the IDN_ID column), you could also try something like

    and instr( v_options, '[' || local_id || ']' ) > 0

where V_OPTIONS is constructed in the proc to look something like '[1][3][9][17][20001]'

Received on Thu Jan 08 2004 - 11:03:07 CST

Original text of this message

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