Page
Library
Module
Module type
Parameter
Class
Class type
Source
Freetds.DblibSourceLow level binding to the DB-lib part of freetds. These bindings mimic the C API and therefore some functions must be used in the right order. Look at the FreeTDS User Guide and Sybase documentation for fine points. Use OCamlDBI with the freetds driver for an easier interaction with such databases.
Value that contains all information needed by Freetds.Dblib to manage communications with the server.
type version = | V42Works with all products, subject to limitations.
*)| V46| V70Includes support for the extended datatypes in SQL Server 7.0 (such as char/varchar fields of more than 255 characters), and support for Unicode.
*)| V71Include support for bigint (64 bit integers), variant and collation on all fields. Collation is not widely used.
*)| V72Includes support for varchar(max), varbinary(max), xml datatypes and MARS.
*)| V73Includes support for time, date, datetime2, datetimeoffset.
*)| V74Includes support for session recovery.
*)Protocol version. Note that the protocol version is chosen in your freetds.conf file or via the environment variable TDSVER (which supersedes the configuration file). See Choosing a TDS protocol version to help you choose. Be warned that 4.x versions of the protcol do not allow empty strings which will be returned as strings of length 1.
val connect :
?user:string ->
?password:string ->
?charset:string ->
?language:string ->
?application:string ->
?version:version ->
string ->
dbprocessconnect server: open a connection to the given database server.
Send the SQL command to the server and wait for an answer.
Warning: There is one absolutely crucial, inflexible, unalterable requirement: the application must process all rows produced by the query. Before the dbprocess can be used for another query, the application must either fetch all rows, or cancel the results and receive an acknowledgement from the server.
Cancel the query currently being retrieved, (retriving and) discarding all pending rows.
results conn returns true if some results are available and false if the query produced no results. There may be several results if COMPUTE clauses are used. One MUST CALL this function before trying to retrieve any rows.
colname conn c returns the name of a regular result column c. The first column has number 1.
type data = | NULL| STRING of string| TINY of int| SMALL of int| INT of int| INT32 of int32| INT64 of int64| FLOAT of float| DATETIME of int * int * int * int * int * int * int * int(year, month, day, hour, minute, second, millisecond, zone)
*)| MONEY of float| BIT of bool| BINARY of string| NUMERIC of string| DECIMAL of stringGet count of rows processed.
type severity = | INFOInformational, non-error.
*)| USERUser error.
*)| NONFATALNon-fatal error.
*)| CONVERSIONError in DB-Library data conversion.
*)| SERVERThe Server has returned an error flag.
*)| TIMEWe have exceeded our timeout period while waiting for a response from the Server—the dbprocess is still alive.
| PROGRAMCoding error in user program.
*)| RESOURCERunning out of resources—the dbprocess may be dead.
| COMMFailure in communication with Server—the dbprocess is dead.
| FATALFatal error—the dbprocess is dead.
| CONSISTENCYInternal software error—please open an issue.
*)Error(severity, message) is raised on dblib errors. You can change the reaction to some errors by installing your own handler with err_handler.
err_handler f installs f as the default error handler for non-OS related errors and errors not coming from the server. f is given the severity, the number of the error (see the 400 or so error numbers sybdb.h, macros SYBE...) and the message.
msg_handler f installs f as the default message handler for messages coming from the server. f is given the severity, the line number, and the message.
settime seconds Set the number of seconds that DB-Library will wait for a server response to a SQL command. If not response is obtained within that period, raise Error(TIME, _).