module Ocamlodbc: sig
.. end
Interface to databases.
exception SQL_Error of string
To report errors.
type
sql_column_type =
| |
SQL_unknown |
| |
SQL_char |
| |
SQL_numeric |
| |
SQL_decimal |
| |
SQL_integer |
| |
SQL_smallint |
| |
SQL_float |
| |
SQL_real |
| |
SQL_double |
| |
SQL_varchar |
| |
SQL_date |
| |
SQL_time |
| |
SQL_timestamp |
| |
SQL_longvarchar |
| |
SQL_binary |
| |
SQL_varbinary |
| |
SQL_longvarbinary |
| |
SQL_bigint |
| |
SQL_tinyint |
| |
SQL_bit |
The various SQL types for columns.
module SQL_column: sig
.. end
Classic interface
type
connection
The type of connections to databases.
val connect : string -> string -> string -> connection
create base user passwd
creates a connection to data source
base
, as user user
, with password passwd
.
Raises SQL_Error
if we could not connect to the database.
val disconnect : connection -> unit
Disconnect from a database. The given connection should not be used
after this function was called.
Raises SQL_Error
if an error occured while disconnecting.
val execute : connection -> string -> int * string list list
execute c q
executes query q
through connection c
and
returns the result as a pair (error_code, recordlist)
,
where a record is a string list
. The error_code
is 0
if no error occured.
val execute_with_info : connection ->
string -> int * (string * sql_column_type) list * string list list
Object-oriented interface
class data_base : string -> string -> string ->
object
.. end