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: OCI and Input Arrays

Re: OCI and Input Arrays

From: Ron Reidy <rereidy_at_indra.com>
Date: Tue, 04 Feb 2003 08:05:37 -0700
Message-ID: <3E3FD6C1.6010205@indra.com>


Look at the "Named Datatype Binds" for binding C variables to PL/SQL tables in the OCI docs.

--
Ron Reidy
Oracle DBA

Pete2003 wrote:

> Hi,
>
> C++:
> I have a simple C++ array:
>
> char szStrings[3][100];
> strcpy(szStrings[0], "Hello");
> strcpy(szStrings[1], "There");
> strcpy(szStrings[2], "World");
>
> Oracle:
> arrType is a table type of varchar2(100)
> I have a stored procedure:
> Procedure testProc( inArr IN arrType )
> DECLARE
> nIdx NUMBER;
> BEGIN
> FOR nIdx IN 0..2 LOOP
> INSERT INTO test_table VALUES(inArr(nIdx));
> END LOOP;
> END
>
> So to call it in C++ (OCI) I would call it with sql statement:
>
> char *sql = "BEGIN testProc(:myArray); END;";
>
> now I need to know how and what do I bind to get this to work ... could
> anybody please give me an example ....
>
> Thanks
>
> --
> Posted via http://dbforums.com
Received on Tue Feb 04 2003 - 09:05:37 CST

Original text of this message

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