本文整理汇总了C++中IPreparedQuery::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ IPreparedQuery::Destroy方法的具体用法?C++ IPreparedQuery::Destroy怎么用?C++ IPreparedQuery::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPreparedQuery
的用法示例。
在下文中一共展示了IPreparedQuery::Destroy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQL_PrepareQuery
static cell_t SQL_PrepareQuery(IPluginContext *pContext, const cell_t *params)
{
IDatabase *db = NULL;
HandleError err;
if ((err = g_DBMan.ReadHandle(params[1], DBHandle_Database, (void **)&db))
!= HandleError_None)
{
return pContext->ThrowNativeError("Invalid database Handle %x (error: %d)", params[1], err);
}
char *query, *error;
size_t maxlength = (size_t)params[4];
pContext->LocalToString(params[2], &query);
pContext->LocalToString(params[3], &error);
IPreparedQuery *qr = db->PrepareQuery(query, error, maxlength);
if (!qr)
{
return BAD_HANDLE;
}
Handle_t hndl = g_HandleSys.CreateHandle(hStmtType, qr, pContext->GetIdentity(), g_pCoreIdent, NULL);
if (hndl == BAD_HANDLE)
{
qr->Destroy();
return BAD_HANDLE;
}
return hndl;
}
示例2: OnHandleDestroy
virtual void OnHandleDestroy(HandleType_t type, void *object)
{
if (type == hCombinedQueryType)
{
CombinedQuery *combined = (CombinedQuery *)object;
combined->query->Destroy();
delete combined;
} else if (type == hStmtType) {
IPreparedQuery *query = (IPreparedQuery *)object;
query->Destroy();
}
}
示例3: PrepareQueryEx
IQuery *SqDatabase::DoQueryEx(const char *query, size_t len)
{
IPreparedQuery *pQuery = PrepareQueryEx(query, len, NULL, 0, NULL);
if (!pQuery)
{
return NULL;
}
if (!pQuery->Execute())
{
pQuery->Destroy();
return NULL;
}
return pQuery;
}