當前位置: 首頁>>代碼示例>>C++>>正文


C++ EndQuery函數代碼示例

本文整理匯總了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;
}
開發者ID:yajing1007,項目名稱:test,代碼行數:52,代碼來源:ClientInfo.cpp

示例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();
}
開發者ID:70599,項目名稱:Waterfox,代碼行數:29,代碼來源:WebGL2ContextQueries.cpp

示例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;
}
開發者ID:yajing1007,項目名稱:test,代碼行數:61,代碼來源:ClientInfo.cpp

示例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;
}
開發者ID:Verlihub,項目名稱:verlihub,代碼行數:13,代碼來源:cconfmysql.cpp

示例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;
}
開發者ID:Artea,項目名稱:mangos-svn,代碼行數:18,代碼來源:QueryResultPostgre.cpp

示例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;
}
開發者ID:Sanzzes,項目名稱:wopc-core,代碼行數:19,代碼來源:QueryResultMysql.cpp

示例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);
}
開發者ID:mkatri,項目名稱:sigmod13,代碼行數:20,代碼來源:core.c

示例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;
}
開發者ID:imane-jym,項目名稱:gp,代碼行數:22,代碼來源:QueryResultMysql.cpp

示例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;
}
開發者ID:Artea,項目名稱:mangos-svn,代碼行數:23,代碼來源:QueryResultSqlite.cpp

示例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;
}
開發者ID:LordVoldemort,項目名稱:Shindorei,代碼行數:24,代碼來源:QueryResultPostgre.cpp

示例11: EndQuery

QueryResultMysql::~QueryResultMysql()
{
    EndQuery();
}
開發者ID:Sanzzes,項目名稱:wopc-core,代碼行數:4,代碼來源:QueryResultMysql.cpp

示例12: EndQuery

QueryResult::~QueryResult()
{
    EndQuery();
}
開發者ID:Suwai,項目名稱:SunfireCore,代碼行數:4,代碼來源:QueryResult.cpp

示例13: EndQuery

int cConfMySQL::EndQuery()
{
	return EndQuery(mQuery);
}
開發者ID:Verlihub,項目名稱:verlihub,代碼行數:4,代碼來源:cconfmysql.cpp


注:本文中的EndQuery函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。