📄 orarowid.cpp
字号:
#include "stdafx.h"
#define __OCICPP_INTERNAL_USE_
#include "OraRowID.h"
/*! \class OCICPP::OraRowID
\brief Client-side representation of a unique identifier for a row within the Oracle server
*/
OCICPP::OraRowID::OraRowID(OCIEnv *envhp,OCIError *errhp,OCIParam *param,ub2 type,int rows) :
OraType(env,errhp,param,type,rows),rowid(0)
{
ReqType=SQLT_RDD; /* request Oracle 8 RowID */
size=0;
rowid=(OCIRowid **)calloc(nRows,sizeof(OCIRowid *));
for(int i=0;i<nRows;i++) {
if(OCIDescriptorAlloc((void *)envhp,(void **)&rowid[i],OCI_DTYPE_ROWID,0,0)!=OCI_SUCCESS) {
throw OraError("OCICPPLIB: Cannot make new ROWID: Handle Allocation failed",OCICPPERROR);
}
}
}
OCICPP::OraRowID::~OraRowID() {
for(int i=0;i<nRows;i++) {
OCIDescriptorFree(rowid[i],OCI_DTYPE_ROWID);
}
free(rowid);
OCIHandleFree(definehp,OCI_HTYPE_DEFINE);
}
void OCICPP::OraRowID::define(OCIStmt *stmt,int col) {
CHECKERR(err, OCIDefineByPos(stmt,&definehp, err, col+1, rowid, -1,ReqType,
(dvoid *) null, 0, (ub2 *)0, OCI_DEFAULT));
}
void OCICPP::OraRowID::getStr(std::string &str,int row) {
str.assign(typeName);
}
/*
void OCICPP::OraRowID::getRowID(RowID &rid) {
rid.init(this);
}
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -