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 -> Problems Binding Arrays in OCI

Problems Binding Arrays in OCI

From: Shawn Murphy <mistershawn_at_hotmail.com>
Date: 16 Jun 2003 18:27:28 -0700
Message-ID: <f8ca2ab0.0306161727.60629b17@posting.google.com>


I've been working on this for a while to no avail. This is a rough outline of the code snippet I'm using...

char* mySQL = "BEGIN; FORALL j..1 INSERT INTO MYTABLE (col) VALUES (:col1(j)); END;"

double myValues[1];
myValues[0] = 1;

/* prepare statement */

rc = OCIBindByName(hstmt, &bndp, mErrhp,

		   (text *)":col1", strlen("col1"), 
		   (ub1 *)&myValues, sizeof(double), 
		   SQLT_FLT, pIndicator, 
                   (ub2 *) 0, (ub2 *) 0, (ub4) 0, (ub4 *) 0,
OCI_DEFAULT); rc = OCIBindArrayOfStruct( bndp, mErrhp, (ub4) sizeof(double),

                           (ub4) 0, (ub4) 0, (ub4) 0 );

/* execute statement */

The binds return success, and the bind by name works fine for a single value, but when I execute this for an array, I get the following error:

Error - ORA-06550: line 1, column 53:
 PLS-00382: expression is of wrong type
 ORA-06550: line 1, column 7:
 PL/SQL: SQL Statement ignored

Any ideas?

Thanks,
Shawn Received on Mon Jun 16 2003 - 20:27:28 CDT

Original text of this message

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