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

Home -> Community -> Usenet -> c.d.o.server -> Re: Binding an arbitrary number of arguments

Re: Binding an arbitrary number of arguments

From: David Fetter <shackle_at_fetter.org>
Date: 3 Oct 2000 23:34:21 GMT
Message-ID: <8rdqdt$9if$1@bob.news.rcn.net>

Todd Noel <dracula452_at_my-deja.com> wrote:

> I'm trying to generate a dynamic SELECT query that has an arbitrary
> number of arguments using C++ and OCI 7.3. The query has the
> following form:
 

> SELECT COLUMN1
> FROM TABLE1
> WHERE COLUMN2 IN (:A, :B, :C, ... );
 
> The COLUMN2 value must be contained in the corresponding list (A, B,
> C, ...). This list will contain an arbitrary number of values that
> are not available when the query is generated. Is there a way to
> bind that list of values to a C++ array? Or is there some other
> approach that will work?

Funny you should mention it. I've made some PL/SQL packages that use

TYPE string_array
IS TABLE OF VARCHAR2(4000) then do the usual index-by table operations to split 'em out and EXECUTE IMMEDIATE to do the resulting fun w/dynamic SQL statements. This only works in Oracle 8i or better.

HTH :) Cheers,
D

-- 
          David Fetter            888 O'Farrell Street Apt E1205
       david_at_fetter.org           San Francisco, CA 94109-9046
http://fetter.org/~shackle phone: +1 415 567 2690 fax: +1 415 567 2340

There's Adam Clymer, major league asshole from the New York Times.
                                 George W. Bush
                                 September 4, 2000
                                 "changing the tone" in Washington
Received on Tue Oct 03 2000 - 18:34:21 CDT

Original text of this message

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