Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> problem getting ROWID with OCIAttrGet()
I'm trying to do an 'insert' and then a 'select for update' based on the rowid of the newly inserted row. It crashes at OCIAttrGet().
sqlText = "insert into test1 (a) values (empty_clob())" sqlText2 = "select a from test1 where rowid = ?? for update" OCIRowid *rowId;
OCIDescriptorAlloc(envhp, &rowId, OCI_DTYPE_ROWID, 0, 0);
OCIStmtPrepare(stmthp, errhp, sqlText, strlen(sqlText), OCI_NTV_SYNTAX,
OCI_DEFAULT);
OCIStmtExecute(svchp, stmthp, errhp, 1, 0, 0, 0, OCI_DEFAULT);
OCIAttrGet(stmthp, OCI_HTYPE_STMT, &rowId, sizeof(OCIRowid *), OCI_ATTR_ROWID, errhp);
Note: If I don't include the OCIAttrGet and base the 'select for update' on other criteria it works fine.
thanks!
heidi
heidi_at_stepforward.org Received on Fri Jun 05 1998 - 00:00:00 CDT