当前位置: 首页>>代码示例>>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;未经允许,请勿转载。