Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> problem getting ROWID with OCIAttrGet()

problem getting ROWID with OCIAttrGet()

From: Heidi K. Barg <heidi_at_stepforward.org>
Date: 1998/06/05
Message-ID: <6l9rjj$7fp$1@cleavage.canuck.com>#1/1

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

Original text of this message

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