Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> using OCIRowidToChar
Hi
I am trying to use OCIRowidToChar with a select for update statement.
After the call to
OCIStmtExecute,
I call
OCIRowid * rowid;
/* allocate descriptor with OCIDescriptorAlloc() */
status = OCIDescriptorAlloc ((dvoid *) envhp, (dvoid **) &rowid,
(ub4) OCI_DTYPE_ROWID, (size_t) 0, (dvoid **) 0);
status = OCIAttrGet ((dvoid*) stmthp, OCI_HTYPE_STMT,
(dvoid*) rowid, (ub4 *) 0, OCI_ATTR_ROWID, (OCIError *) errhp);
and then
unsigned char * rowIDstring = new unsigned char[128];
ub2 rowIDLength = 0;
if ((status = OCIRowidToChar(rowid, rowIDstring, &rowIDLength, errhp))
!= OCI_SUCCESS)
{
checkerr(errhp, status);
return status;
}
The problem is that the call to OCIRowidToChar returns the following
error:
"ORA-01405: fetched column value is NULL"
How can I work around this problem? If I run the query manually (in sqlplus without the for update) then I get 1 row back, so why is the rowid null?
thanks Received on Wed Aug 20 2003 - 13:14:23 CDT