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 -> Re: Bind an array with OCI -- against a release 7.3 or later server

Re: Bind an array with OCI -- against a release 7.3 or later server

From: <Torsten.Reichert_at_gmx.net>
Date: Thu, 27 Jan 2000 18:16:03 +0100
Message-ID: <38907D53.3A00F704@gmx.net>


I have a similiar problem.
The example cdemo5.c oracle delivers with Oracle Server 7.3 does not work, too.
I suppose the following remark (see section ====== !!!!! ====== )in the documentation may give us a hint.

maybe if you find a solution you could post it here.

Thank you

obndra
Purpose
obndra() associates the address of a program variable or array with a placeholder in a SQL statement or PL/SQL block.

Syntax
obndra(Cda_Def *cursor, text *sqlvar, [sword sqlvl],

        ub1 *progv, sword progvl, sword ftype,
        <sword scale>, [sb2 *indp], [ub2 *alen],
        [ub2 *arcode], [ub4 maxsiz], [ub4 *cursiz],
        <text *fmt>, <sword fmtl>, <sword fmtt>);
Comments
You can use obndra() to bind scalar variables or arrays in your program to placeholders in a SQL statement or a PL/SQL block. The alen parameter of the
obndra() function allows you to change the size of the bound variable without actually rebinding the variable. Note:
If cursor is a cursor variable that has been OPENed FOR in a PL/SQL block, then obndra() returns an error, unless a new SQL statement or PL/SQL block has
been parsed on it.
When you bind arrays in your program to PL/SQL tables, you must use obndra(), because this function provides additional parameters that allow you to control the
maximum size of the table and to retrieve the current table size after the block executes.

Eric Arrigo wrote:
>
> Hi,
>
> I'm trying to bind an array to a placeholder in a simple OCI query like:
>
> "select * from foo where bar in :ph"
>
> I want to bind ':ph' to a memory array filled with values of bar I need to
> get.
> I try without success to use obndra, and get an ORA-01414 error (Invalid
> array length when trying to bind array).
>
> Does anyone know if it is possible to make this without use PL/Sql ?
>
> Any info about this would be greatly appreciated.
>
> Eric.

--
II*


Received on Thu Jan 27 2000 - 11:16:03 CST

Original text of this message

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