Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> How to use OCIRowid ?
I have two statements, one for select (m_hstmt) and another for update
(m_hstmtUpdate).
I want use the rowid of the first stmt for update the second stmt.
But I can't !!!
my code :
text *textSQL = (text*)"UPDATE emp SET sal=100 WHERE ROWID = :id"; OCIRowid* m_rowid;
OCIDescriptorAlloc ( GetEnv(), (dvoid**)&m_rowid, (ub4)OCI_DTYPE_ROWID, 0, (dvoid**)0 );
OCIAttrGet ((dvoid*) m_hstmt, OCI_HTYPE_STMT, (dvoid*) m_rowid, (ub4 *) 0, OCI_ATTR_ROWID, (OCIError *) GetError());
OCIStmtPrepare(m_hstmtUpdate, GetError(), (text *) textSQL, (ub4) strlen((char*)textSQL), OCI_NTV_SYNTAX, OCI_DEFAULT);
OCIBind * pBind=NULL;
OCIHandleAlloc( m_hstmtUpdate, (dvoid **)&pBind,(ub4)OCI_HTYPE_BIND,
(CONST size_t) 0, (dvoid **) 0);
OCIBindByName ( m_hstmtUpdate, &pBind, GetError(), (text*)":id", -1,
(ub1 *) m_rowid, 18 + 1, SQLT_RDD, (dvoid *) 0, (ub2 *) 0, (ub2 *) 0,
(ub4) 0, (ub4 *) 0, OCI_DEFAULT);
OCIStmtExecute(GetSvcCtx(), m_hstmtUpdate, GetError(), 1, 0, 0, 0, OCI_DEFAULT); I use Oracle 8, OCI and Visual C++ 5. Received on Mon May 04 1998 - 04:52:32 CDT
![]() |
![]() |