本文整理汇总了C++中DataBase::updateInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ DataBase::updateInfo方法的具体用法?C++ DataBase::updateInfo怎么用?C++ DataBase::updateInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::updateInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getStrongestStrength
void GetStrongestStrength::getStrongestStrength() {
/*SELECT
top 1 *
from GridFieldStrenthAddBaseNum
where gid = 2
ORDER BY
dbo.GridFieldStrenthAddBaseNum.GId ASC,
dbo.GridFieldStrenthAddBaseNum.GRSRP DESC*/
DataBase db;
//此处的判断条件有问题,gid和表中的行数并不对应,应该用id来进行索引
//因此改成了到grid表中,查找grid的个数来判断
int gRealSnrCount = DBHelper::queryTableInfoNum("Grid");
for(int id = 1;id <= gRealSnrCount;id++) {
if(852==id) {
int kk = 1;
}
string sqlString = "SELECT top 1 GId,AId,GRSRP from GridFieldStrenthAddBaseNum where gid = ";
sqlString.append(ChangeTypeTool::intToString(id));
sqlString.append(" ORDER BY GId ASC, GRSRP DESC;");
vector<vector<string>> vectorString = db.getObjectInfo(sqlString);
if(vectorString.size()>=1) {
vector<vector<string>>::iterator iter = vectorString.begin();
vector<string>::iterator subIter = (*iter).begin();
int gid = ChangeTypeTool::stringToInt(*subIter++);
long aid = ChangeTypeTool::stringToLong(*subIter++);
double strength = ChangeTypeTool::stringToDouble(*subIter);
sqlString = "update Grid set GAId = ";
sqlString.append(ChangeTypeTool::intToString(aid));
sqlString.append(" ,GRealSNR = ");
sqlString.append(ChangeTypeTool::doubleToString(strength));
sqlString.append(" where GId = ");
sqlString.append(ChangeTypeTool::intToString(gid));
sqlString.append(";");
db.updateInfo(sqlString);
}
}
}