indexing
     description: "ODBC specification"
     date: "$Date$"
     revision: "$Revision$"

class interface
     ODBC

feature

     Database_handle_name: STRING is "ODBC"
     
feature -- DATABASE_BOOLEAN

     sql_name_boolean: STRING
           ensure then
                 textual_outlook: Result.is_equal ("bit")
     
feature -- DATABASE_CHARACTER

     sql_name_character: STRING
           ensure then
                 Result.is_equal ("char (1)")
     
feature -- DATABASE_DATETIME

     sql_name_datetime: STRING
     
feature -- DATABASE_DOUBLE

     sql_name_double: STRING
           ensure then
                 Result.is_equal ("float")
     
feature -- DATABASE_INTEGER

     sql_name_integer: STRING
           ensure then
                 Result.is_equal ("integer")
     
feature -- DATABASE_REAL

     sql_name_real: STRING
           ensure then
                 Result.is_equal ("real")
     
feature -- DATABASE_STRING

     sql_name_string: STRING
           ensure then
                 Result.is_equal ("char (")
     
feature -- External

     begin

     c_boolean_type: INTEGER

     c_character_type: INTEGER

     c_date_type: INTEGER

     c_float_type: INTEGER

     c_integer_type: INTEGER

     c_real_type: INTEGER

     c_string_type: INTEGER

     close_cursor (no_descriptor: INTEGER)

     commit

     connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING)
           require -- from DATABASE
                 True
           require else
                 data_source_set: data_source /= void

     conv_type (indicator: INTEGER; index: INTEGER): INTEGER

     database_make (i: INTEGER)

     disconnect

     exec_immediate (no_descriptor: INTEGER; command: STRING)

     get_boolean_data (no_descriptor: INTEGER; ind: INTEGER): BOOLEAN

     get_col_len (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_col_type (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_count (no_descriptor: INTEGER): INTEGER

     get_data_len (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_date_data (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_day (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_error_code: INTEGER

     get_error_message: POINTER

     get_float_data (no_descriptor: INTEGER; ind: INTEGER): DOUBLE

     get_hour (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_integer_data (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_min (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_month (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_real_data (no_descriptor: INTEGER; ind: INTEGER): REAL

     get_sec (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     get_warn_message: POINTER

     get_year (no_descriptor: INTEGER; ind: INTEGER): INTEGER

     identifier_quoter: STRING

     init_order (no_descriptor: INTEGER; command: STRING)

     is_null_data (no_descriptor: INTEGER; ind: INTEGER): BOOLEAN
                 -- Is last retrieved data null?

     new_descriptor: INTEGER

     next_row (no_descriptor: INTEGER)

     put_col_name (no_descriptor: INTEGER; index: INTEGER; ar: SPECIAL [CHARACTER]; max_len: INTEGER): INTEGER

     put_data (no_descriptor: INTEGER; index: INTEGER; ar: SPECIAL [CHARACTER]; max_len: INTEGER): INTEGER

     qualifier_seperator: STRING

     rollback

     sensitive_mixed: BOOLEAN

     start_order (no_descriptor: INTEGER)

     support_proc: INTEGER

     terminate_order (no_descriptor: INTEGER)

     trancount: INTEGER
     
feature -- For DATABASE_CHANGE

     descriptor_is_available: BOOLEAN

     hide_qualifier (tmp_strg: STRING): POINTER

     pre_immediate (descriptor, i: INTEGER)

     results_order (no_descriptor: INTEGER): INTEGER
                 -- Fetch all the rows resulting from the sql query
                 -- Default value zero
                 -- Only for Sybase
                 -- (from DATABASE)
     
feature -- For DATABASE_DYN_STORE

     unset_catalog_flag (desc: INTEGER)
     
feature -- For DATABASE_FORMAT

     date_to_str (object: DATE_TIME): STRING
                 -- String representation in SQL of object

     False_representation: STRING is "0"

     string_format (object: STRING): STRING
                 -- String representation in SQL of object.

     True_representation: STRING is "1"
     
feature -- For DATABASE_PROC

     drop_proc_not_supported

     exec_proc_not_supported

     has_row_number: BOOLEAN
                 -- May the database store the text of a stored procedure in more than one
                 -- row?
                 -- Default value False
                 -- Redefined for Ingres
                 -- (from DATABASE)

     map_var_after: STRING
                 -- Redefined for Sybase
                 -- (from DATABASE)

     map_var_before: STRING
                 -- Redefined for Sybase
                 -- (from DATABASE)

     Map_var_between: STRING is "@"

     map_var_between_2: STRING
                 -- Equal type
                 -- Only for Ingres
                 -- (from DATABASE)

     Name_proc_lower: BOOLEAN is True

     proc_args: BOOLEAN
                 -- True if the execution of the stored procedure is
                 -- "execute procedure_name (argument1='sireude')"
                 -- False if "execute procedure_name ('sireude')"
                 -- Default value False
                 -- True for Sybase
                 -- (from DATABASE)

     select_exists (name: STRING): STRING

     Select_text: STRING is ""

     sql_adapt_db (sql: STRING): STRING

     Sql_after_exec: STRING is " }"

     Sql_as: STRING is " as "

     Sql_creation: STRING is "CREATE PROC"

     Sql_end: STRING is ""

     Sql_execution: STRING is "{CALL "

     store_proc_not_supported

     support_drop_proc: BOOLEAN

     Support_sql_of_proc: BOOLEAN is False

     support_stored_proc: BOOLEAN

     text_not_supported: STRING
     
feature -- For DATABASE_REPOSITORY

     Max_char_size: INTEGER is 254

     selection_string (rep_qualifier, rep_owner, repository_name: STRING): STRING

     Sql_string: STRING is "char ("

     sql_string2 (int: INTEGER): STRING
     
feature -- For DATABASE_SELECTION, DATABASE_CHANGE

     bind_parameter (table: ARRAY [ANY]; parameters: ARRAY [ANY]; descriptor: INTEGER; sql: STRING)

     Normal_parse: BOOLEAN is False

     parse (descriptor: INTEGER; uht: HASH_TABLE [ANY, STRING]; uhandle: HANDLE; sql: STRING): BOOLEAN

     result_order (descriptor: INTEGER)
                 -- Fetch one row resulting from the sql query
                 -- Default value zero
                 -- For Sybase
                 -- (from DATABASE)
     
feature -- For DATABASE_STATUS

     clear_error
                 -- Reset database error status.

     found: BOOLEAN
                 -- Is there any record matching the last
                 -- selection condition used ?

     is_error_updated: BOOLEAN
                 -- Has an ODBC function been called since last update which may have
                 -- updated error code, error message or warning message?
     
feature -- For DATABASE_STORE

     dim_rep_diff (repository_dimension, db_field_count: INTEGER): BOOLEAN
                 -- Is the dimension of the repository different to the field count of the object to insert?
                 -- If yes, make a default map_table
                 -- Default value False
                 -- Only for Sybase
                 -- (from DATABASE)

     put_column_name (repository: DATABASE_REPOSITORY [like Current]; map_table: ARRAY [INTEGER]): STRING

     update_map_table_error (uhandle: HANDLE; map_table: ARRAY [INTEGER]; ind: INTEGER)
     
feature -- For database types

     convert_string_type (r_any: ANY; field_name, class_name: STRING): ANY
                 -- Convert r_any to the expected object.
                 -- By default returns r_any, redefined in ORACLE to return
                 -- an INTEGER_REF when field_name is "data_type".
                 -- (from DATABASE)
           require -- from DATABASE
                 r_any_not_void: r_any /= void
                 field_name_not_void: field_name /= void
                 class_name_not_void: class_name /= void
           ensure -- from DATABASE
                 valid_result: Result /= void
     
feature -- LOGIN and DATABASE_APPL only for password_ok and user_name_ok

     password_ensure (name, passwd, uname, upasswd: STRING): BOOLEAN

     password_ok (upasswd: STRING): BOOLEAN

     user_name_ok (uname: STRING): BOOLEAN
     
invariant

           -- from ANY
     reflexive_equality: standard_is_equal (Current)
     reflexive_conformance: conforms_to (Current)

end -- class ODBC