Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> oci trouble
Hello guys,
Could you tell me why, under XP & Oracle client 10.0.1 this little
piece of code crashes on
OCIStmtExecute() ?
int r;
OCIStmt *p_sql;
char *query = "BEGIN open :cur1 FOR select 1,2,3 FROM dual; open :cur2
FOR select 1,2,3 FROM dual; end;";
dvoid *curs1, *curs2;
OCIBind *bind;
r = OCILogon(env, err, &svc, ....);
//---- connection to Oracle server is ok...
r = OCIHandleAlloc(env, &p_sql, OCI_HTYPE_STMT, (size_t) 0, (dvoid **) 0);
r = OCIStmtPrepare(p_sql, err, query, strlen(query), OCI_NTV_SYNTAX,
OCI_DEFAULT);
r = OCIHandleAlloc(env, &curs1, OCI_HTYPE_STMT, 0, NULL);
r = OCIBindByName(p_sql, &bind, err, ":cur1", -1, &curs1, 0, SQLT_RSET,
0, 0, 0, 0, 0, OCI_DEFAULT);
r = OCIHandleAlloc(env, &curs2, OCI_HTYPE_STMT, 0, NULL);
r = OCIBindByName(p_sql, &bind, err, ":cur2", -1, &curs2, 0, SQLT_RSET,
0, 0, 0, 0, 0, OCI_DEFAULT);
//---- at this time, no errors were returned by Oracle, now...
//---- now error with "Unhandled error with ORACOMMON10.dll"
r = OCIStmtExecute(svc, p_sql, err, 1, 0, NULL, NULL,
OCI_COMMIT_ON_SUCCESS);
Where is my fault ??
thanx... Received on Tue Mar 14 2006 - 18:35:50 CST