本文整理汇总了C++中Query::getQueryID方法的典型用法代码示例。如果您正苦于以下问题:C++ Query::getQueryID方法的具体用法?C++ Query::getQueryID怎么用?C++ Query::getQueryID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Query
的用法示例。
在下文中一共展示了Query::getQueryID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pushStatistics
void pushStatistics(const Query& query)
{
try
{
work tr(*_connection);
string sql = "insert into \"scidb_stat\"(query_id, ts, query_str, query_stat)"
" values ($1, now(), $2, $3)";
_connection->prepare("append_stat", sql)
("bigint", treat_direct)
("varchar", treat_string)
("varchar", treat_string);
stringstream ss;
query.writeStatistics(ss);
tr.prepared("append_stat")
(query.getQueryID())
(query.queryString)
(ss.str()).exec();
_connection->unprepare("append_stat");
tr.commit();
}
catch (const sql_error &e)
{
throw SYSTEM_EXCEPTION(SCIDB_SE_SYSCAT, SCIDB_LE_PG_QUERY_EXECUTION_FAILED) << e.query()
<< e.what();
}
catch (const PGSTD::runtime_error &e)
{
throw SYSTEM_EXCEPTION(SCIDB_SE_SYSCAT, SCIDB_LE_CANT_CONNECT_PG) << e.what();
}
catch (const Exception &e)
{
throw;
}
catch (const std::exception &e)
{
throw SYSTEM_EXCEPTION(SCIDB_SE_SYSCAT, SCIDB_LE_UNKNOWN_ERROR) << e.what();
}
catch (...)
{
throw SYSTEM_EXCEPTION(SCIDB_SE_SYSCAT, SCIDB_LE_UNKNOWN_ERROR) <<
"Unknown exception when connecting to system catalog";
}
}