本文整理汇总了C++中NdbOperation::interpretedDeleteTuple方法的典型用法代码示例。如果您正苦于以下问题:C++ NdbOperation::interpretedDeleteTuple方法的具体用法?C++ NdbOperation::interpretedDeleteTuple怎么用?C++ NdbOperation::interpretedDeleteTuple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NdbOperation
的用法示例。
在下文中一共展示了NdbOperation::interpretedDeleteTuple方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: delete_rows
void delete_rows(Ndb* pMyNdb, int tupleTest, int opType) {
/****************************************************************
* Delete rows from SimpleTable
*
***************************************************************/
int check = 1 ;
int loop_count_ops = nRecords ;
int readValue[MAXATTR] = {0};
NdbConnection *MyTransaction = NULL ;
NdbOperation *MyOperation = NULL ;
TTYPE ret_val = NO_FAIL ;
ndbout << "Deleting records ..."<< endl << endl;
for (int count=0 ; count < loop_count_ops ; count++) {
MyTransaction = pMyNdb->startTransaction();
if (!MyTransaction) error_handler(pMyNdb->getNdbError(), NO_FAIL) ;
MyOperation = MyTransaction->getNdbOperation(tableName);
if (!MyOperation) error_handler(pMyNdb->getNdbError(), NO_FAIL) ;
check = MyOperation->interpretedDeleteTuple();
if( check == -1 ) error_handler(MyTransaction->getNdbError(), NO_FAIL) ;
check = MyOperation->equal( attrName[0], (char*)&pkValue[count] );
if( check == -1 ) error_handler(MyTransaction->getNdbError(), NO_FAIL) ;
switch(tupleTest) {
case 1:
ret_val = t_exitMethods(count+1, MyOperation, opType);
break;
case 2:
ret_val = t_incValue(count+1, MyOperation);
break;
case 3:
ret_val = t_subValue(count+1, MyOperation);
break;
case 4:
ret_val = t_readAttr(count+1, MyOperation);
break;
case 5:
ret_val = t_writeAttr(count+1, MyOperation);
break;
case 6:
ret_val = t_loadConst(count+1, MyOperation, opType);
break;
case 7:
ret_val = t_branch(count+1, MyOperation);
break;
case 8:
ret_val = t_branchIfNull(count+1, MyOperation);
break;
case 9:
ret_val = t_addReg(count+1, MyOperation);
break;
case 10:
ret_val = t_subReg(count+1, MyOperation);
break;
case 11:
ret_val = t_subroutineWithBranchLabel(count+1, MyOperation);
break;
default:
break ;
}
if(11 != tupleTest)MyOperation->getValue(attrName[1], (char*)&readValue) ;
if (MyTransaction->execute( Commit ) == -1 ) {
error_handler(MyTransaction->getNdbError(), ret_val);
} else if (NO_FAIL == ret_val /*|| UNDEF == ret_val*/ ) {
ndbout << "OK" << endl;
} else {
bTestPassed = -1;
ndbout << "Test passed when expected to fail" << endl;
}//if
ndbout << endl;
pMyNdb->closeTransaction(MyTransaction);
}
ndbout << "Finished deleting records" << endl;
return;
};