我使用oracle-occi-api更新数据,代码:
Environment * env = Environment::createEnvironment();
Connection * con = env->createConnection("nm_web","nm_web99","192.168.26.42/orcl");
Statement *stmt;
string sqlStmt =
"update tb_yctp_daq_record set deal_status=1";
try{
stmt = con->createStatement(sqlStmt);
stmt->execute();
}catch(SQLException ex)
{
cout<<"Exception thrown for updateRow"<<endl;
cout<<"Error number: "<< ex.getErrorCode() << endl;
cout<<ex.getMessage() << endl;
}
con->commit();
con->terminateStatement (stmt);
Environment::terminateEnvironment(env);
return true;
但是这个代码卡在";stmt=con->createStatement(sqlStmt(">
我只是没有在PLSQL工具中提交更新操作,这可能会导致锁定此表。