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 -> using OCIRowidToChar

using OCIRowidToChar

From: yy343 <deevandeevan_at_hotmail.com>
Date: 20 Aug 2003 11:14:23 -0700
Message-ID: <557df4d5.0308201014.7c3934ea@posting.google.com>


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

Original text of this message

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