Exemplo n.º 1
0
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 );
    }
Exemplo n.º 2
0
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 );
    }
Exemplo n.º 3
0
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 );
    }
Exemplo n.º 4
0
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 );
    }
Exemplo n.º 5
0
SQLRETURN SQLForeignKeys(
    SQLHSTMT           statement_handle,
    SQLCHAR            *szpk_catalog_name,
    SQLSMALLINT        cbpk_catalog_name,
    SQLCHAR            *szpk_schema_name,
    SQLSMALLINT        cbpk_schema_name,
    SQLCHAR            *szpk_table_name,
    SQLSMALLINT        cbpk_table_name,
    SQLCHAR            *szfk_catalog_name,
    SQLSMALLINT        cbfk_catalog_name,
    SQLCHAR            *szfk_schema_name,
    SQLSMALLINT        cbfk_schema_name,
    SQLCHAR            *szfk_table_name,
    SQLSMALLINT        cbfk_table_name )
{
    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 s5[ 100 + LOG_MESSAGE_LEN ], 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\tPK Catalog Name = %s\
\n\t\t\tPK Schema Name = %s\
\n\t\t\tPK Table Name = %s\
\n\t\t\tFK Catalog Name = %s\
\n\t\t\tFK Schema Name = %s\
\n\t\t\tFK Table Name = %s",
                statement,
                __string_with_length( s1, szpk_catalog_name, cbpk_catalog_name ), 
                __string_with_length( s2, szpk_schema_name, cbpk_schema_name ), 
                __string_with_length( s3, szpk_table_name, cbpk_table_name ), 
                __string_with_length( s4, szfk_catalog_name, cbfk_catalog_name ), 
                __string_with_length( s5, szfk_schema_name, cbfk_schema_name ), 
                __string_with_length( s6, szfk_table_name, cbfk_table_name ));

        dm_log_write( __FILE__, 
                __LINE__, 
                LOG_INFO, 
                LOG_INFO, 
                statement -> msg );
    }