本文整理汇总了C++中dm_log_write函数的典型用法代码示例。如果您正苦于以下问题:C++ dm_log_write函数的具体用法?C++ dm_log_write怎么用?C++ dm_log_write使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dm_log_write函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SQLCancel
SQLRETURN SQLCancel( SQLHSTMT statement_handle )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p",
statement );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例2: SQLGetDiagRec
SQLRETURN SQLGetDiagRec( SQLSMALLINT handle_type,
SQLHANDLE handle,
SQLSMALLINT rec_number,
SQLCHAR *sqlstate,
SQLINTEGER *native,
SQLCHAR *message_text,
SQLSMALLINT buffer_length,
SQLSMALLINT *text_length_ptr )
{
SQLRETURN ret;
SQLCHAR s0[ 32 ], s1[ 100 + LOG_MESSAGE_LEN ];
SQLCHAR s2[ 100 + LOG_MESSAGE_LEN ];
if ( rec_number < 1 )
{
return SQL_ERROR;
}
if ( handle_type == SQL_HANDLE_ENV )
{
DMHENV environment = ( DMHENV ) handle;
if ( !__validate_env( environment ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
thread_protect( SQL_HANDLE_ENV, environment );
if ( log_info.log_flag )
{
sprintf( environment -> msg,
"\n\t\tEntry:\
\n\t\t\tEnvironment = %p\
\n\t\t\tRec Number = %d\
\n\t\t\tSQLState = %p\
\n\t\t\tNative = %p\
\n\t\t\tMessage Text = %p\
\n\t\t\tBuffer Length = %d\
\n\t\t\tText Len Ptr = %p",
environment,
rec_number,
sqlstate,
native,
message_text,
buffer_length,
text_length_ptr );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
environment -> msg );
}
示例3: SQLSetParam
SQLRETURN SQLSetParam( SQLHSTMT statement_handle,
SQLUSMALLINT parameter_number,
SQLSMALLINT value_type,
SQLSMALLINT parameter_type,
SQLULEN length_precision,
SQLSMALLINT parameter_scale,
SQLPOINTER parameter_value,
SQLLEN *strlen_or_ind )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tParam Number = %d\
\n\t\t\tValue Type = %d %s\
\n\t\t\tParameter Type = %d %s\
\n\t\t\tLength Precision = %d\
\n\t\t\tParameter Scale = %d\
\n\t\t\tParameter Value = %p\
\n\t\t\tStrLen Or Ind = %p",
statement,
parameter_number,
value_type,
__c_as_text( value_type ),
parameter_type,
__sql_as_text( parameter_type ),
(int)length_precision,
(int)parameter_scale,
(void*)parameter_value,
(void*)strlen_or_ind );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例4: SQLSpecialColumns
SQLRETURN SQLSpecialColumns( SQLHSTMT statement_handle,
SQLUSMALLINT identifier_type,
SQLCHAR *catalog_name,
SQLSMALLINT name_length1,
SQLCHAR *schema_name,
SQLSMALLINT name_length2,
SQLCHAR *table_name,
SQLSMALLINT name_length3,
SQLUSMALLINT scope,
SQLUSMALLINT nullable )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tIdentifier Type = %d\
\n\t\t\tCatalog Name = %s\
\n\t\t\tSchema Name = %s\
\n\t\t\tTable Name = %s\
\n\t\t\tScope = %d\
\n\t\t\tNullable = %d",
statement,
identifier_type,
__string_with_length( s1, catalog_name, name_length1 ),
__string_with_length( s2, schema_name, name_length2 ),
__string_with_length( s3, table_name, name_length3 ),
scope,
nullable );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例5: SQLBrowseConnect
SQLRETURN SQLBrowseConnect(
SQLHDBC hdbc,
SQLCHAR *conn_str_in,
SQLSMALLINT len_conn_str_in,
SQLCHAR *conn_str_out,
SQLSMALLINT conn_str_out_max,
SQLSMALLINT *ptr_conn_str_out )
{
DMHDBC connection = (DMHDBC) hdbc;
struct con_struct con_struct;
char *driver, *dsn;
char lib_name[ INI_MAX_PROPERTY_VALUE + 1 ];
char driver_name[ INI_MAX_PROPERTY_VALUE + 1 ];
char in_str[ BUFFER_LEN ];
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN];
SQLWCHAR *uc_in_str;
int warnings;
/*
* check connection
*/
if ( !__validate_dbc( connection ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( connection );
if ( log_info.log_flag )
{
sprintf( connection -> msg, "\n\t\tEntry:\
\n\t\t\tConnection = %p\
\n\t\t\tStr In = %s\
\n\t\t\tStr Out = %p\
\n\t\t\tStr Out Max = %d\
\n\t\t\tPtr Conn Str Out = %p",
connection,
__string_with_length( s1, conn_str_in, len_conn_str_in ),
conn_str_out,
conn_str_out_max,
ptr_conn_str_out );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
connection -> msg );
}
示例6: SQLGetData
SQLRETURN SQLGetData( SQLHSTMT statement_handle,
SQLUSMALLINT column_number,
SQLSMALLINT target_type,
SQLPOINTER target_value,
SQLLEN buffer_length,
SQLLEN *strlen_or_ind )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ];
int unicode_switch = 0;
SQLLEN ind_value;
SQLCHAR *as1 = NULL;
SQLCHAR s3[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tColumn Number = %d\
\n\t\t\tTarget Type = %d %s\
\n\t\t\tBuffer Length = %d\
\n\t\t\tTarget Value = %p\
\n\t\t\tStrLen Or Ind = %p",
statement,
column_number,
target_type,
__sql_as_text( target_type ),
(int)buffer_length,
target_value,
(void*)strlen_or_ind );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例7: SQLSetDescField
SQLRETURN SQLSetDescField( SQLHDESC descriptor_handle,
SQLSMALLINT rec_number,
SQLSMALLINT field_identifier,
SQLPOINTER value,
SQLINTEGER buffer_length )
{
/*
* not quite sure how the descriptor can be
* allocated to a statement, all the documentation talks
* about state transitions on statement states, but the
* descriptor may be allocated with more than one statement
* at one time. Which one should I check ?
*/
DMHDESC descriptor = (DMHDESC) descriptor_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
/*
* check descriptor
*/
if ( !__validate_desc( descriptor ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( descriptor );
if ( log_info.log_flag )
{
sprintf( descriptor -> msg, "\n\t\tEntry:\
\n\t\t\tDescriptor = %p\
\n\t\t\tRec Number = %d\
\n\t\t\tField Ident = %s\
\n\t\t\tValue = %p\
\n\t\t\tBuffer Length = %d",
descriptor,
rec_number,
__desc_attr_as_string( s1, field_identifier ),
value,
(int)buffer_length );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
descriptor -> msg );
}
示例8: SQLSetEnvAttr
SQLRETURN SQLSetEnvAttr( SQLHENV environment_handle,
SQLINTEGER attribute,
SQLPOINTER value,
SQLINTEGER string_length )
{
DMHENV environment = (DMHENV) environment_handle;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
/*
* we may do someting with these later
*/
if ( !environment_handle &&
( attribute == SQL_ATTR_CONNECTION_POOLING ||
attribute == SQL_ATTR_CP_MATCH ))
{
return SQL_SUCCESS;
}
/*
* check environment
*/
if ( !__validate_env( environment ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( environment );
if ( log_info.log_flag )
{
sprintf( environment -> msg, "\n\t\tEntry:\
\n\t\t\tEnvironment = %p\
\n\t\t\tAttribute = %s\
\n\t\t\tValue = %p\
\n\t\t\tStrLen = %d",
environment,
__env_attr_as_string( s1, attribute ),
value,
(int)string_length );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
environment -> msg );
}
示例9: SQLColumnPrivileges
SQLRETURN SQLColumnPrivileges(
SQLHSTMT statement_handle,
SQLCHAR *catalog_name,
SQLSMALLINT name_length1,
SQLCHAR *schema_name,
SQLSMALLINT name_length2,
SQLCHAR *table_name,
SQLSMALLINT name_length3,
SQLCHAR *column_name,
SQLSMALLINT name_length4 )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tCatalog Name = %s\
\n\t\t\tSchema Name = %s\
\n\t\t\tTable Name = %s\
\n\t\t\tColumn Name = %s",
statement,
__string_with_length( s1, catalog_name, name_length1 ),
__string_with_length( s2, schema_name, name_length2 ),
__string_with_length( s3, table_name, name_length3 ),
__string_with_length( s4, column_name, name_length4 ));
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例10: SQLColAttribute
SQLRETURN SQLColAttribute ( SQLHSTMT statement_handle,
SQLUSMALLINT column_number,
SQLUSMALLINT field_identifier,
SQLPOINTER character_attribute,
SQLSMALLINT buffer_length,
SQLSMALLINT *string_length,
SQLPOINTER numeric_attribute )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret = 0;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tColumn Number = %d\
\n\t\t\tField Identifier = %s\
\n\t\t\tCharacter Attr = %p\
\n\t\t\tBuffer Length = %d\
\n\t\t\tString Length = %p\
\n\t\t\tNumeric Attribute = %p",
statement,
column_number,
__col_attr_as_string( s1, field_identifier ),
character_attribute,
buffer_length,
string_length,
numeric_attribute );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例11: SQLDescribeParam
SQLRETURN SQLDescribeParam(
SQLHSTMT statement_handle,
SQLUSMALLINT ipar,
SQLSMALLINT *pf_sql_type,
SQLULEN *pcb_param_def,
SQLSMALLINT *pib_scale,
SQLSMALLINT *pf_nullable )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ], s4[ 100 + LOG_MESSAGE_LEN ];
SQLCHAR s6[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tParameter Number = %d\
\n\t\t\tSQL Type = %p\
\n\t\t\tParam Def = %p\
\n\t\t\tScale = %p\
\n\t\t\tNullable = %p",
statement,
ipar,
pf_sql_type,
pcb_param_def,
pib_scale,
pf_nullable );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例12: SQLGetDiagField
SQLRETURN SQLGetDiagField( SQLSMALLINT handle_type,
SQLHANDLE handle,
SQLSMALLINT rec_number,
SQLSMALLINT diag_identifier,
SQLPOINTER diag_info_ptr,
SQLSMALLINT buffer_length,
SQLSMALLINT *string_length_ptr )
{
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
if ( handle_type == SQL_HANDLE_ENV )
{
DMHENV environment = ( DMHENV ) handle;
if ( !__validate_env( environment ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
thread_protect( SQL_HANDLE_ENV, environment );
if ( log_info.log_flag )
{
sprintf( environment -> msg,
"\n\t\tEntry:\
\n\t\t\tEnvironment = %p\
\n\t\t\tRec Number = %d\
\n\t\t\tDiag Ident = %d\
\n\t\t\tDiag Info Ptr = %p\
\n\t\t\tBuffer Length = %d\
\n\t\t\tString Len Ptr = %p",
environment,
rec_number,
diag_identifier,
diag_info_ptr,
buffer_length,
string_length_ptr );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
environment -> msg );
}
示例13: SQLProcedures
SQLRETURN SQLProcedures(
SQLHSTMT statement_handle,
SQLCHAR *sz_catalog_name,
SQLSMALLINT cb_catalog_name,
SQLCHAR *sz_schema_name,
SQLSMALLINT cb_schema_name,
SQLCHAR *sz_proc_name,
SQLSMALLINT cb_proc_name )
{
DMHSTMT statement = (DMHSTMT) statement_handle;
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ], s2[ 100 + LOG_MESSAGE_LEN ], s3[ 100 + LOG_MESSAGE_LEN ];
/*
* check statement
*/
if ( !__validate_stmt( statement ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( statement );
if ( log_info.log_flag )
{
sprintf( statement -> msg, "\n\t\tEntry:\
\n\t\t\tStatement = %p\
\n\t\t\tCatalog Name = %s\
\n\t\t\tSchema Name = %s\
\n\t\t\tProc Name = %s",
statement,
__string_with_length( s1, sz_catalog_name, cb_catalog_name ),
__string_with_length( s2, sz_schema_name, cb_schema_name ),
__string_with_length( s3, sz_proc_name, cb_proc_name ));
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
statement -> msg );
}
示例14: SQLGetInfo
SQLRETURN SQLGetInfo( SQLHDBC connection_handle,
SQLUSMALLINT info_type,
SQLPOINTER info_value,
SQLSMALLINT buffer_length,
SQLSMALLINT *string_length )
{
DMHDBC connection = (DMHDBC)connection_handle;
SQLRETURN ret = SQL_SUCCESS;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
/*
* check connection
*/
if ( !__validate_dbc( connection ))
{
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
"Error: SQL_INVALID_HANDLE" );
return SQL_INVALID_HANDLE;
}
function_entry( connection );
if ( log_info.log_flag )
{
sprintf( connection -> msg, "\n\t\tEntry:\
\n\t\t\tConnection = %p\
\n\t\t\tInfo Type = %s (%d)\
\n\t\t\tInfo Value = %p\
\n\t\t\tBuffer Length = %d\
\n\t\t\tStrLen = %p",
connection,
__info_as_string( s1, info_type ),
info_type,
info_value,
(int)buffer_length,
(void*)string_length );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
connection -> msg );
}
示例15: SQLCancelHandle
SQLRETURN SQLCancelHandle( SQLSMALLINT handle_type, SQLHANDLE handle )
{
SQLRETURN ret;
SQLCHAR s1[ 100 + LOG_MESSAGE_LEN ];
if ( handle_type == SQL_HANDLE_DBC )
{
DMHDBC connection = ( DMHDBC ) handle;
if ( !__validate_dbc( connection ))
{
return SQL_INVALID_HANDLE;
}
thread_protect( SQL_HANDLE_DBC, connection );
if ( log_info.log_flag )
{
sprintf( connection -> msg,
"\n\t\tEntry:\
\n\t\t\tConnection = %p",
connection );
dm_log_write( __FILE__,
__LINE__,
LOG_INFO,
LOG_INFO,
connection -> msg );
}