本文整理汇总了C++中Statement::GetDiagnosticRecords方法的典型用法代码示例。如果您正苦于以下问题:C++ Statement::GetDiagnosticRecords方法的具体用法?C++ Statement::GetDiagnosticRecords怎么用?C++ Statement::GetDiagnosticRecords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statement
的用法示例。
在下文中一共展示了Statement::GetDiagnosticRecords方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQLBindCol
SQLRETURN SQLBindCol(SQLHSTMT stmt,
SQLUSMALLINT colNum,
SQLSMALLINT targetType,
SQLPOINTER targetValue,
SQLLEN bufferLength,
SQLLEN* strLengthOrIndicator)
{
using namespace odbc::type_traits;
using odbc::Statement;
using odbc::app::ApplicationDataBuffer;
LOG_MSG("SQLBindCol called: index=" << colNum << ", type=" << targetType <<
", targetValue=" << reinterpret_cast<size_t>(targetValue) <<
", bufferLength=" << bufferLength <<
", lengthInd=" << reinterpret_cast<size_t>(strLengthOrIndicator));
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->BindColumn(colNum, targetType, targetValue, bufferLength, strLengthOrIndicator);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例2: SQLGetData
SQLRETURN SQLGetData(SQLHSTMT stmt,
SQLUSMALLINT colNum,
SQLSMALLINT targetType,
SQLPOINTER targetValue,
SQLLEN bufferLength,
SQLLEN* strLengthOrIndicator)
{
using namespace odbc::type_traits;
using odbc::Statement;
using odbc::app::ApplicationDataBuffer;
LOG_MSG("SQLGetData called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
OdbcNativeType::Type driverType = ToDriverType(targetType);
ApplicationDataBuffer dataBuffer(driverType, targetValue, bufferLength, strLengthOrIndicator);
statement->GetColumnData(colNum, dataBuffer);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例3: SQLPrimaryKeys
SQLRETURN SQLPrimaryKeys(SQLHSTMT stmt,
SQLCHAR* catalogName,
SQLSMALLINT catalogNameLen,
SQLCHAR* schemaName,
SQLSMALLINT schemaNameLen,
SQLCHAR* tableName,
SQLSMALLINT tableNameLen)
{
using odbc::Statement;
using utility::SqlStringToString;
LOG_MSG("SQLPrimaryKeys called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
std::string catalog = SqlStringToString(catalogName, catalogNameLen);
std::string schema = SqlStringToString(schemaName, schemaNameLen);
std::string table = SqlStringToString(tableName, tableNameLen);
LOG_MSG("catalog: " << catalog);
LOG_MSG("schema: " << schema);
LOG_MSG("table: " << table);
statement->ExecuteGetPrimaryKeysQuery(catalog, schema, table);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例4: SQLGetStmtAttr
SQLRETURN SQLGetStmtAttr(SQLHSTMT stmt,
SQLINTEGER attr,
SQLPOINTER valueBuf,
SQLINTEGER valueBufLen,
SQLINTEGER* valueResLen)
{
using odbc::Statement;
LOG_MSG("SQLGetStmtAttr called");
#ifdef ODBC_DEBUG
using odbc::type_traits::StatementAttrIdToString;
LOG_MSG("Attr: " << StatementAttrIdToString(attr) << " (" << attr << ")");
#endif //ODBC_DEBUG
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->GetAttribute(attr, valueBuf, valueBufLen, valueResLen);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例5: SQLSpecialColumns
SQLRETURN SQLSpecialColumns(SQLHSTMT stmt,
SQLSMALLINT idType,
SQLCHAR* catalogName,
SQLSMALLINT catalogNameLen,
SQLCHAR* schemaName,
SQLSMALLINT schemaNameLen,
SQLCHAR* tableName,
SQLSMALLINT tableNameLen,
SQLSMALLINT scope,
SQLSMALLINT nullable)
{
using namespace odbc;
using utility::SqlStringToString;
LOG_MSG("SQLSpecialColumns called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
std::string catalog = SqlStringToString(catalogName, catalogNameLen);
std::string schema = SqlStringToString(schemaName, schemaNameLen);
std::string table = SqlStringToString(tableName, tableNameLen);
LOG_MSG("catalog: " << catalog);
LOG_MSG("schema: " << schema);
LOG_MSG("table: " << table);
statement->ExecuteSpecialColumnsQuery(idType, catalog, schema, table, scope, nullable);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例6: SQLDescribeCol
SQLRETURN SQLDescribeCol(SQLHSTMT stmt,
SQLUSMALLINT columnNum,
SQLCHAR* columnNameBuf,
SQLSMALLINT columnNameBufLen,
SQLSMALLINT* columnNameLen,
SQLSMALLINT* dataType,
SQLULEN* columnSize,
SQLSMALLINT* decimalDigits,
SQLSMALLINT* nullable)
{
using odbc::Statement;
using odbc::SqlLen;
LOG_MSG("SQLDescribeCol called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->GetColumnAttribute(columnNum, SQL_DESC_NAME,
reinterpret_cast<char*>(columnNameBuf), columnNameBufLen, columnNameLen, 0);
SqlLen dataTypeRes;
SqlLen columnSizeRes;
SqlLen decimalDigitsRes;
SqlLen nullableRes;
statement->GetColumnAttribute(columnNum, SQL_DESC_TYPE, 0, 0, 0, &dataTypeRes);
statement->GetColumnAttribute(columnNum, SQL_DESC_PRECISION, 0, 0, 0, &columnSizeRes);
statement->GetColumnAttribute(columnNum, SQL_DESC_SCALE, 0, 0, 0, &decimalDigitsRes);
statement->GetColumnAttribute(columnNum, SQL_DESC_NULLABLE, 0, 0, 0, &nullableRes);
LOG_MSG("columnNum: " << columnNum);
LOG_MSG("dataTypeRes: " << dataTypeRes);
LOG_MSG("columnSizeRes: " << columnSizeRes);
LOG_MSG("decimalDigitsRes: " << decimalDigitsRes);
LOG_MSG("nullableRes: " << nullableRes);
LOG_MSG("columnNameBuf: " << (columnNameBuf ? reinterpret_cast<const char*>(columnNameBuf) : "<null>"));
LOG_MSG("columnNameLen: " << (columnNameLen ? *columnNameLen : -1));
if (dataType)
*dataType = static_cast<SQLSMALLINT>(dataTypeRes);
if (columnSize)
*columnSize = static_cast<SQLULEN>(columnSizeRes);
if (decimalDigits)
*decimalDigits = static_cast<SQLSMALLINT>(decimalDigitsRes);
if (nullable)
*nullable = static_cast<SQLSMALLINT>(nullableRes);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例7: SQLCloseCursor
SQLRETURN SQLCloseCursor(SQLHSTMT stmt)
{
using odbc::Statement;
LOG_MSG("SQLCloseCursor called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
statement->Close();
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例8: SQLPutData
SQLRETURN SQLPutData(SQLHSTMT stmt, SQLPOINTER data, SQLLEN strLengthOrIndicator)
{
using namespace ignite::odbc;
LOG_MSG("SQLPutData called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->PutData(data, strLengthOrIndicator);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例9: SQLParamData
SQLRETURN SQLParamData(SQLHSTMT stmt, SQLPOINTER* value)
{
using namespace ignite::odbc;
LOG_MSG("SQLParamData called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->SelectParam(value);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例10: SQLMoreResults
SQLRETURN SQLMoreResults(SQLHSTMT stmt)
{
using odbc::Statement;
LOG_MSG("SQLMoreResults called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->MoreResults();
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例11: SQLGetTypeInfo
SQLRETURN SQLGetTypeInfo(SQLHSTMT stmt, SQLSMALLINT type)
{
using odbc::Statement;
LOG_MSG("SQLGetTypeInfo called: [type=" << type << ']');
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->ExecuteGetTypeInfoQuery(static_cast<int16_t>(type));
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例12: SQLFetchScroll
SQLRETURN SQLFetchScroll(SQLHSTMT stmt, SQLSMALLINT orientation, SQLLEN offset)
{
using odbc::Statement;
LOG_MSG("SQLFetchScroll called");
LOG_MSG("Orientation: " << orientation << " Offset: " << offset);
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->FetchScroll(orientation, offset);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例13: SQLRowCount
SQLRETURN SQLRowCount(SQLHSTMT stmt, SQLLEN* rowCnt)
{
using odbc::Statement;
LOG_MSG("SQLRowCount called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
int64_t res = statement->AffectedRows();
if (rowCnt)
*rowCnt = static_cast<SQLLEN>(res);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例14: SQLForeignKeys
SQLRETURN SQLForeignKeys(SQLHSTMT stmt,
SQLCHAR* primaryCatalogName,
SQLSMALLINT primaryCatalogNameLen,
SQLCHAR* primarySchemaName,
SQLSMALLINT primarySchemaNameLen,
SQLCHAR* primaryTableName,
SQLSMALLINT primaryTableNameLen,
SQLCHAR* foreignCatalogName,
SQLSMALLINT foreignCatalogNameLen,
SQLCHAR* foreignSchemaName,
SQLSMALLINT foreignSchemaNameLen,
SQLCHAR* foreignTableName,
SQLSMALLINT foreignTableNameLen)
{
using odbc::Statement;
using utility::SqlStringToString;
LOG_MSG("SQLForeignKeys called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
std::string primaryCatalog = SqlStringToString(primaryCatalogName, primaryCatalogNameLen);
std::string primarySchema = SqlStringToString(primarySchemaName, primarySchemaNameLen);
std::string primaryTable = SqlStringToString(primaryTableName, primaryTableNameLen);
std::string foreignCatalog = SqlStringToString(foreignCatalogName, foreignCatalogNameLen);
std::string foreignSchema = SqlStringToString(foreignSchemaName, foreignSchemaNameLen);
std::string foreignTable = SqlStringToString(foreignTableName, foreignTableNameLen);
LOG_MSG("primaryCatalog: " << primaryCatalog);
LOG_MSG("primarySchema: " << primarySchema);
LOG_MSG("primaryTable: " << primaryTable);
LOG_MSG("foreignCatalog: " << foreignCatalog);
LOG_MSG("foreignSchema: " << foreignSchema);
LOG_MSG("foreignTable: " << foreignTable);
statement->ExecuteGetForeignKeysQuery(primaryCatalog, primarySchema,
primaryTable, foreignCatalog, foreignSchema, foreignTable);
return statement->GetDiagnosticRecords().GetReturnCode();
}
示例15: SQLDescribeParam
SQLRETURN SQLDescribeParam(SQLHSTMT stmt,
SQLUSMALLINT paramNum,
SQLSMALLINT* dataType,
SQLULEN* paramSize,
SQLSMALLINT* decimalDigits,
SQLSMALLINT* nullable)
{
using namespace ignite::odbc;
LOG_MSG("SQLDescribeParam called");
Statement *statement = reinterpret_cast<Statement*>(stmt);
if (!statement)
return SQL_INVALID_HANDLE;
statement->DescribeParam(paramNum, dataType, paramSize, decimalDigits, nullable);
return statement->GetDiagnosticRecords().GetReturnCode();
}