本文整理汇总了C++中NdbTransaction::readTuple方法的典型用法代码示例。如果您正苦于以下问题:C++ NdbTransaction::readTuple方法的具体用法?C++ NdbTransaction::readTuple怎么用?C++ NdbTransaction::readTuple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NdbTransaction
的用法示例。
在下文中一共展示了NdbTransaction::readTuple方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calc
int
runInterpretedUKLookup(NDBT_Context* ctx, NDBT_Step* step)
{
const NdbDictionary::Table * pTab = ctx->getTab();
Ndb* pNdb = GETNDB(step);
NdbDictionary::Dictionary * dict = pNdb->getDictionary();
const NdbDictionary::Index* pIdx= dict->getIndex(pkIdxName, pTab->getName());
CHK_RET_FAILED(pIdx != 0);
const NdbRecord * pRowRecord = pTab->getDefaultRecord();
CHK_RET_FAILED(pRowRecord != 0);
const NdbRecord * pIdxRecord = pIdx->getDefaultRecord();
CHK_RET_FAILED(pIdxRecord != 0);
const Uint32 len = NdbDictionary::getRecordRowLength(pRowRecord);
Uint8 * pRow = new Uint8[len];
bzero(pRow, len);
HugoCalculator calc(* pTab);
calc.equalForRow(pRow, pRowRecord, 0);
NdbTransaction* pTrans = pNdb->startTransaction();
CHK_RET_FAILED(pTrans != 0);
NdbInterpretedCode code;
code.interpret_exit_ok();
code.finalise();
NdbOperation::OperationOptions opts;
bzero(&opts, sizeof(opts));
opts.optionsPresent = NdbOperation::OperationOptions::OO_INTERPRETED;
opts.interpretedCode = &code;
const NdbOperation * pOp = pTrans->readTuple(pIdxRecord, (char*)pRow,
pRowRecord, (char*)pRow,
NdbOperation::LM_Read,
0,
&opts,
sizeof(opts));
CHK_RET_FAILED(pOp);
int res = pTrans->execute(Commit, AbortOnError);
CHK_RET_FAILED(res == 0);
delete [] pRow;
return NDBT_OK;
}