本文整理汇总了C++中ODBCLOG函数的典型用法代码示例。如果您正苦于以下问题:C++ ODBCLOG函数的具体用法?C++ ODBCLOG怎么用?C++ ODBCLOG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ODBCLOG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQLColAttributes
SQLRETURN SQL_API
SQLColAttributes(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
SQLUSMALLINT FieldIdentifier,
SQLPOINTER CharacterAttributePtr,
SQLSMALLINT BufferLength,
SQLSMALLINT *StringLengthPtr,
SQLLEN *NumericAttributePtr)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLColAttributes " PTRFMT " %u %s\n",
PTRFMTCAST StatementHandle,
(unsigned int) ColumnNumber,
translateFieldIdentifier(FieldIdentifier));
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
return SQLColAttributes_(stmt,
ColumnNumber,
FieldIdentifier,
CharacterAttributePtr,
BufferLength,
StringLengthPtr,
NumericAttributePtr);
}
示例2: SQLRowCount
SQLRETURN SQL_API
SQLRowCount(SQLHSTMT StatementHandle,
SQLLEN *RowCountPtr)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLRowCount %p\n", StatementHandle);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
/* check statement cursor state, query should be executed */
if (stmt->State < EXECUTED0) {
/* Function sequence error */
addStmtError(stmt, "HY010", NULL, 0);
return SQL_ERROR;
}
/* check output parameter */
if (RowCountPtr == NULL) {
/* Invalid use of null pointer */
addStmtError(stmt, "HY009", NULL, 0);
return SQL_ERROR;
}
/* We can now set the "number of result set rows" value */
*RowCountPtr = (SQLLEN) stmt->rowcount;
return SQL_SUCCESS;
}
示例3: SQLColAttribute
SQLRETURN SQL_API
SQLColAttribute(SQLHSTMT StatementHandle,
SQLUSMALLINT ColumnNumber,
SQLUSMALLINT FieldIdentifier,
SQLPOINTER CharacterAttributePtr,
SQLSMALLINT BufferLength,
SQLSMALLINT *StringLengthPtr,
LENP_OR_POINTER_T NumericAttributePtr)
{
#ifdef ODBCDEBUG
ODBCLOG("SQLColAttribute " PTRFMT " %s\n",
PTRFMTCAST StatementHandle,
translateFieldIdentifier(FieldIdentifier));
#endif
if (!isValidStmt((ODBCStmt *) StatementHandle))
return SQL_INVALID_HANDLE;
clearStmtErrors((ODBCStmt *) StatementHandle);
return SQLColAttribute_((ODBCStmt *) StatementHandle,
ColumnNumber,
FieldIdentifier,
CharacterAttributePtr,
BufferLength,
StringLengthPtr,
NumericAttributePtr);
}
示例4: SQLSetParam
SQLRETURN SQL_API
SQLSetParam(SQLHSTMT StatementHandle,
SQLUSMALLINT ParameterNumber,
SQLSMALLINT ValueType,
SQLSMALLINT ParameterType,
SQLULEN LengthPrecision,
SQLSMALLINT ParameterScale,
SQLPOINTER ParameterValue,
SQLLEN *StrLen_or_Ind)
{
#ifdef ODBCDEBUG
ODBCLOG("SQLSetParam " PTRFMT " %u %s %s " ULENFMT " %d\n",
PTRFMTCAST StatementHandle, (unsigned int) ParameterNumber,
translateCType(ValueType),
translateSQLType(ParameterType),
ULENCAST LengthPrecision, (int) ParameterScale);
#endif
/* map this call to SQLBindParameter as described in ODBC 3.0 SDK help */
return SQLBindParameter_((ODBCStmt *) StatementHandle,
ParameterNumber,
SQL_PARAM_INPUT_OUTPUT,
ValueType,
ParameterType,
LengthPrecision,
ParameterScale,
ParameterValue,
SQL_SETPARAM_VALUE_MAX,
StrLen_or_Ind);
}
示例5: SQLGetStmtAttrW
SQLRETURN SQL_API
SQLGetStmtAttrW(SQLHSTMT StatementHandle,
SQLINTEGER Attribute,
SQLPOINTER ValuePtr,
SQLINTEGER BufferLength,
SQLINTEGER *StringLengthPtr)
{
#ifdef ODBCDEBUG
ODBCLOG("SQLGetStmtAttrW " PTRFMT " %s " PTRFMT " %d " PTRFMT "\n",
PTRFMTCAST StatementHandle, translateStmtAttribute(Attribute),
PTRFMTCAST ValuePtr, (int) BufferLength,
PTRFMTCAST StringLengthPtr);
#endif
if (!isValidStmt((ODBCStmt *) StatementHandle))
return SQL_INVALID_HANDLE;
clearStmtErrors((ODBCStmt *) StatementHandle);
/* there are no string-valued attributes */
return MNDBGetStmtAttr((ODBCStmt *) StatementHandle,
Attribute,
ValuePtr,
BufferLength,
StringLengthPtr);
}
示例6: SQLGetDiagRec
SQLRETURN SQL_API
SQLGetDiagRec(SQLSMALLINT HandleType,
SQLHANDLE Handle,
SQLSMALLINT RecNumber,
SQLCHAR *SQLState,
SQLINTEGER *NativeErrorPtr,
SQLCHAR *MessageText,
SQLSMALLINT BufferLength,
SQLSMALLINT *TextLengthPtr)
{
#ifdef ODBCDEBUG
ODBCLOG("SQLGetDiagRec %s " PTRFMT " %d %d\n",
HandleType == SQL_HANDLE_ENV ? "Env" : HandleType == SQL_HANDLE_DBC ? "Dbc" : HandleType == SQL_HANDLE_STMT ? "Stmt" : "Desc",
PTRFMTCAST Handle, (int) RecNumber, (int) BufferLength);
#endif
return MNDBGetDiagRec(HandleType,
Handle,
RecNumber,
SQLState,
NativeErrorPtr,
MessageText,
BufferLength,
TextLengthPtr);
}
示例7: SQLGetDiagField
SQLRETURN SQL_API
SQLGetDiagField(SQLSMALLINT HandleType,
SQLHANDLE Handle,
SQLSMALLINT RecNumber,
SQLSMALLINT DiagIdentifier,
SQLPOINTER DiagInfoPtr,
SQLSMALLINT BufferLength,
SQLSMALLINT *StringLengthPtr)
{
#ifdef ODBCDEBUG
ODBCLOG("SQLGetDiagField %s %p %d %s %p %d %p\n",
HandleType == SQL_HANDLE_ENV ? "Env" : HandleType == SQL_HANDLE_DBC ? "Dbc" : HandleType == SQL_HANDLE_STMT ? "Stmt" : "Desc",
Handle, (int) RecNumber,
translateDiagIdentifier(DiagIdentifier),
DiagInfoPtr,
(int) BufferLength, StringLengthPtr);
#endif
return MNDBGetDiagField(HandleType,
Handle,
RecNumber,
DiagIdentifier,
DiagInfoPtr,
BufferLength,
StringLengthPtr);
}
示例8: SQLFetchScroll
SQLRETURN SQL_API
SQLFetchScroll(SQLHSTMT StatementHandle,
SQLSMALLINT FetchOrientation,
SQLLEN FetchOffset)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLFetchScroll %p %s " LENFMT "\n",
StatementHandle,
translateFetchOrientation(FetchOrientation),
LENCAST FetchOffset);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
/* check statement cursor state, query should be executed */
if (stmt->State < EXECUTED0 || stmt->State == EXTENDEDFETCHED) {
/* Function sequence error */
addStmtError(stmt, "HY010", NULL, 0);
return SQL_ERROR;
}
if (stmt->State == EXECUTED0) {
/* Invalid cursor state */
addStmtError(stmt, "24000", NULL, 0);
return SQL_ERROR;
}
return MNDBFetchScroll(stmt, FetchOrientation, FetchOffset,
stmt->ImplRowDescr->sql_desc_array_status_ptr);
}
示例9: SQLForeignKeys
SQLRETURN SQL_API
SQLForeignKeys(SQLHSTMT StatementHandle,
SQLCHAR *PKCatalogName,
SQLSMALLINT NameLength1,
SQLCHAR *PKSchemaName,
SQLSMALLINT NameLength2,
SQLCHAR *PKTableName,
SQLSMALLINT NameLength3,
SQLCHAR *FKCatalogName,
SQLSMALLINT NameLength4,
SQLCHAR *FKSchemaName,
SQLSMALLINT NameLength5,
SQLCHAR *FKTableName,
SQLSMALLINT NameLength6)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLForeignKeys " PTRFMT " ", PTRFMTCAST StatementHandle);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
return SQLForeignKeys_(stmt, PKCatalogName, NameLength1,
PKSchemaName, NameLength2,
PKTableName, NameLength3,
FKCatalogName, NameLength4,
FKSchemaName, NameLength5,
FKTableName, NameLength6);
}
示例10: SQLSpecialColumns
SQLRETURN SQL_API
SQLSpecialColumns(SQLHSTMT StatementHandle,
SQLUSMALLINT IdentifierType,
SQLCHAR *CatalogName,
SQLSMALLINT NameLength1,
SQLCHAR *SchemaName,
SQLSMALLINT NameLength2,
SQLCHAR *TableName,
SQLSMALLINT NameLength3,
SQLUSMALLINT Scope,
SQLUSMALLINT Nullable)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLSpecialColumns %p %s ",
StatementHandle,
translateIdentifierType(IdentifierType));
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
return MNDBSpecialColumns(stmt,
IdentifierType,
CatalogName, NameLength1,
SchemaName, NameLength2,
TableName, NameLength3,
Scope,
Nullable);
}
示例11: SQLColumns
SQLRETURN SQL_API
SQLColumns(SQLHSTMT StatementHandle,
SQLCHAR *CatalogName,
SQLSMALLINT NameLength1,
SQLCHAR *SchemaName,
SQLSMALLINT NameLength2,
SQLCHAR *TableName,
SQLSMALLINT NameLength3,
SQLCHAR *ColumnName,
SQLSMALLINT NameLength4)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLColumns " PTRFMT, PTRFMTCAST StatementHandle);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
return SQLColumns_(stmt,
CatalogName, NameLength1,
SchemaName, NameLength2,
TableName, NameLength3,
ColumnName, NameLength4);
}
示例12: SQLDataSources
SQLRETURN SQL_API
SQLDataSources(SQLHENV EnvironmentHandle,
SQLUSMALLINT Direction,
SQLCHAR *ServerName,
SQLSMALLINT BufferLength1,
SQLSMALLINT *NameLength1,
SQLCHAR *Description,
SQLSMALLINT BufferLength2,
SQLSMALLINT *NameLength2)
{
ODBCEnv *env = (ODBCEnv *) EnvironmentHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLDataSources " PTRFMT " %s\n",
PTRFMTCAST EnvironmentHandle, translateDirection(Direction));
#endif
if (!isValidEnv(env))
return SQL_INVALID_HANDLE;
clearEnvErrors(env);
return MNDBDataSources(env, Direction,
ServerName, BufferLength1, NameLength1,
Description, BufferLength2, NameLength2);
}
示例13: SQLFetch
SQLRETURN SQL_API
SQLFetch(SQLHSTMT StatementHandle)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLFetch " PTRFMT "\n", PTRFMTCAST StatementHandle);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
assert(stmt->hdl);
/* check statement cursor state, query should be executed */
if (stmt->State < EXECUTED0 || stmt->State == EXTENDEDFETCHED) {
/* Function sequence error */
addStmtError(stmt, "HY010", NULL, 0);
return SQL_ERROR;
}
if (stmt->State == EXECUTED0) {
/* Invalid cursor state */
addStmtError(stmt, "24000", NULL, 0);
return SQL_ERROR;
}
stmt->startRow += stmt->rowSetSize;
return MNDBFetch(stmt, stmt->ImplRowDescr->sql_desc_array_status_ptr);
}
示例14: SQLNumResultCols
SQLRETURN SQL_API
SQLNumResultCols(SQLHSTMT StatementHandle,
SQLSMALLINT *ColumnCountPtr)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLNumResultCols " PTRFMT "\n", PTRFMTCAST StatementHandle);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
/* check statement cursor state, query should be prepared or executed */
if (stmt->State == INITED) {
/* Function sequence error */
addStmtError(stmt, "HY010", NULL, 0);
return SQL_ERROR;
}
/* check output parameter */
if (ColumnCountPtr == NULL) {
/* Invalid use of null pointer */
addStmtError(stmt, "HY009", NULL, 0);
return SQL_ERROR;
}
/* We can now set the "number of output columns" value */
/* Note: row count can be 0 (for non SELECT queries) */
*ColumnCountPtr = stmt->ImplRowDescr->sql_desc_count;
return SQL_SUCCESS;
}
示例15: SQLProcedures
SQLRETURN SQL_API
SQLProcedures(SQLHSTMT StatementHandle,
SQLCHAR *CatalogName,
SQLSMALLINT NameLength1,
SQLCHAR *SchemaName,
SQLSMALLINT NameLength2,
SQLCHAR *ProcName,
SQLSMALLINT NameLength3)
{
ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
#ifdef ODBCDEBUG
ODBCLOG("SQLProcedures " PTRFMT " ", PTRFMTCAST StatementHandle);
#endif
if (!isValidStmt(stmt))
return SQL_INVALID_HANDLE;
clearStmtErrors(stmt);
return MNDBProcedures(stmt,
CatalogName, NameLength1,
SchemaName, NameLength2,
ProcName, NameLength3);
}