本文整理汇总了C++中EndQuery函数的典型用法代码示例。如果您正苦于以下问题:C++ EndQuery函数的具体用法?C++ EndQuery怎么用?C++ EndQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EndQuery函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _snprintf_s
/* CRelationMgr::Insert()时调用,用于网关初次上线添加记录或重新上线时更新记录 */
bool CClientInfo::AddWangguan(const char * name)
{
char sql_line[NORMAL_XG_BUF_LEN];
char sql_line_exist[NORMAL_XG_BUF_LEN];
int sql_len_exist = _snprintf_s(sql_line_exist, NORMAL_XG_BUF_LEN-1, _TRUNCATE,
"SELECT serial FROM %s WHERE serial='%s'", m_wangguan_table, name);
sql_line_exist[sql_len_exist] = '\0';
MYSQL_RES * existresults = BeginQuery(sql_line_exist); // 查询网关名称看是否已存在
if (NULL == existresults)
{
return FALSE;
}
if(existresults->row_count == 0) // 如果不存在,新添加一项网关上线记录
{
EndQuery(existresults);
int sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"INSERT INTO %s(serial, onoff) VALUES('%s', 1)",
m_wangguan_table, name);
SLOG(4)("AddWangguan = %s", sql_line);
if(-1 == sql_len)
{
return false;
}
sql_line[sql_len] = '\0';
MYSQL_RES * results = BeginQuery(sql_line);
EndQuery(results);
}
else // 如果存在,说明网关重新上线,则更新记录
{
EndQuery(existresults);
int sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"UPDATE %s SET onoff=1 WHERE serial='%s'",
m_wangguan_table, name);
SLOG(4)("AddWangguan = %s", sql_line);
if(-1 == sql_len)
{
return false;
}
sql_line[sql_len] = '\0';
MYSQL_RES * results = BeginQuery(sql_line);
EndQuery(results);
}
return TRUE;
}
示例2: EndQuery
void
WebGL2Context::DeleteQuery(WebGLQuery* query)
{
if (IsContextLost())
return;
if (!query)
return;
if (query->IsDeleted())
return;
if (query->IsActive())
EndQuery(query->mType);
if (mActiveOcclusionQuery && !gl->IsGLES()) {
/* http://www.opengl.org/registry/specs/ARB/occlusion_query.txt
*
* Calling either GenQueriesARB or DeleteQueriesARB while any query of
* any target is active causes an INVALID_OPERATION error to be
* generated.
*/
GenerateWarning("deleteQuery: The WebGL 2 prototype might generate"
" INVALID_OPERATION when deleting a query object while"
" one other is active.");
}
query->RequestDelete();
}
示例3: switch
/* CClientContainer::Delete()中调用,即当删除客户端时,更新其对应网关的客户端记录 */
bool CClientInfo::DecreClientRecord(const char * name, int type)
{
char sql_line[NORMAL_XG_BUF_LEN];
int sql_len;
switch(type)
{
case RM_PHONE:
{
sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"UPDATE %s SET android_phone=android_phone-1 WHERE serial='%s'",
m_client_record_table, name);
SLOG(4)("DecreClientRecord = %s", sql_line);
break;
}
case RM_PY:
{
sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"UPDATE %s SET android_pad=android_pad-1 WHERE serial='%s'",
m_client_record_table, name);
SLOG(4)("DecreClientRecord = %s", sql_line);
break;
}
case RM_PC:
{
sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"UPDATE %s SET pc=pc-1 WHERE serial='%s'",
m_client_record_table, name);
SLOG(4)("DecreClientRecord = %s", sql_line);
break;
}
case TMP:
{
sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"UPDATE %s SET tmp=tmp-1 WHERE serial='%s'",
m_client_record_table, name);
SLOG(4)("DecreClientRecord = %s", sql_line);
break;
}
case iOS:
{
sql_len = _snprintf_s(sql_line, NORMAL_XG_BUF_LEN - 1, _TRUNCATE,
"UPDATE %s SET iOS=iOS-1 WHERE serial='%s'",
m_client_record_table, name);
SLOG(4)("DecreClientRecord = %s", sql_line);
break;
}
default:
break;
}
if(-1 == sql_len)
{
return false;
}
sql_line[sql_len] = '\0';
MYSQL_RES * results = BeginQuery(sql_line);
EndQuery(results);
return TRUE;
}
示例4: SelectFields
bool cConfMySQL::LoadPK()
{
ostringstream query;
SelectFields(query);
WherePKey(query);
if (StartQuery(query.str()) == -1)
return false;
bool found = (Load() >= 0);
EndQuery();
return found;
}
示例5: EndQuery
bool QueryResultPostgre::NextRow()
{
if (!mResult)
return false;
if (mTableIndex >= mRowCount)
{
EndQuery();
return false;
}
for (int j = 0; j < mFieldCount; j++)
{
mCurrentRow[j].SetValue(PQgetvalue(mResult, mTableIndex, j));
}
return true;
}
示例6: mysql_fetch_row
bool QueryResultMysql::NextRow()
{
MYSQL_ROW row;
if (!mResult)
return false;
row = mysql_fetch_row(mResult);
if (!row)
{
EndQuery();
return false;
}
for (uint32 i = 0; i < mFieldCount; i++)
mCurrentRow[i].SetValue(row[i]);
return true;
}
示例7: core_test
void core_test() {
InitializeIndex();
char f[32] = "abcd";
// char f2[32] = "aix";
StartQuery(5, f, MT_EDIT_DIST, 3);
MatchDocument(10, "s");
EndQuery(5);
puts("====");
fflush(0);
DocID did;
QueryID *qid;
unsigned int numRes;
GetNextAvailRes(&did, &numRes, &qid);
int i;
for (i = 0; i < numRes; i++)
printf("---->%d\n", qid[i]);
printf("did = %d, first qid = %d, numRes = %d\n", did, qid[0], numRes);
}
示例8: mysql_fetch_row
bool QueryResultMysql::NextRow()
{
MYSQL_ROW row;
if (!mResult)
return false;
row = mysql_fetch_row(mResult);
if (!row)
{
EndQuery();
return false;
}
long unsigned int * fieldLength = mysql_fetch_lengths(mResult);
for (uint32 i = 0; i < mFieldCount; i++)
{
mCurrentRow[i].SetValue(row[i],fieldLength[i]);
mCurrentRow[i].SetLength(fieldLength[i]);
}
return true;
}
示例9: EndQuery
bool QueryResultSqlite::NextRow()
{
int startIndex;
uint32 i;
if (!mTableData)
return false;
if (mTableIndex >= mRowCount)
{
EndQuery();
return false;
}
startIndex = (mTableIndex + 1) * mFieldCount;
for (i = 0; i < mFieldCount; i++)
{
mCurrentRow[i].SetValue(mTableData[startIndex + i]);
}
++mTableIndex;
return true;
}
示例10: EndQuery
bool QueryResultPostgre::NextRow()
{
if (!mResult)
return false;
if (mTableIndex >= mRowCount)
{
EndQuery();
return false;
}
char* pPQgetvalue;
for (int j = 0; j < mFieldCount; j++)
{
pPQgetvalue = PQgetvalue(mResult, mTableIndex, j);
if(pPQgetvalue && !(*pPQgetvalue))
pPQgetvalue = NULL;
mCurrentRow[j].SetValue(pPQgetvalue);
}
++mTableIndex;
return true;
}
示例11: EndQuery
QueryResultMysql::~QueryResultMysql()
{
EndQuery();
}
示例12: EndQuery
QueryResult::~QueryResult()
{
EndQuery();
}
示例13: EndQuery
int cConfMySQL::EndQuery()
{
return EndQuery(mQuery);
}