56 lines
2.2 KiB
TeX
56 lines
2.2 KiB
TeX
|
%&latex -*- latex -*-
|
||
|
|
||
|
\chapter{Open Database Base Connectivity Interface (ODBC)}
|
||
|
|
||
|
ODBC is an standarized API for talking to database drivers, thus
|
||
|
enabling your application to use any ODBC compliant database driver to
|
||
|
connect to SQL databases. The Scheme Shell provides access to almost
|
||
|
all functions and data structures of ODBC.
|
||
|
|
||
|
The ODBC API was designed by Microsoft Corporation and has been
|
||
|
updated several times. At the time of writing, ODBC API version 3.5
|
||
|
was current. However, the scsh also provides access to all functions
|
||
|
needed to use an ODBC driver manager starting from version 1.0.
|
||
|
|
||
|
\section{ODBC Overview}
|
||
|
|
||
|
An ODBC setup consists of several components which arrange around a so
|
||
|
called ODBC driver manager. The driver manager provides an abstract
|
||
|
implementation of the ODBC API for accessing databases. The concrete
|
||
|
implementation, which contains e.g. contains the code to connect to a
|
||
|
certain SQL database depends on the database to access. Therefore,
|
||
|
this codes resides in a ODBC driver, which is usually part of the SQL
|
||
|
database distribution. In some cases ODBC driver managers bring along
|
||
|
their own drivers.
|
||
|
|
||
|
The \textit{Data Source Name}, DSN for short, associates credentials
|
||
|
needed to logon a certain database with a the apropriate driver to
|
||
|
access that database. If an application wishes to connect to a DSN
|
||
|
the driver manager loads the ##angegeben## driver and routes all
|
||
|
functions call by the application via this driver to the database.
|
||
|
|
||
|
The are at least two implementation of ODBC driver managers for UNIX
|
||
|
systems: unixODBC~\cite{BlaBla} and iODBC~\cite{BlaBla}. The Scheme
|
||
|
shell can use both ODBC driver managers. However, you have to decide
|
||
|
during compilation of scsh which one to use.
|
||
|
|
||
|
Support for ODBC at this time is quite low-level---for alsmost each
|
||
|
function or data structure in the ODBC API there is a function call in
|
||
|
Scheme. This chapter describes how to call the API functions from
|
||
|
Scheme, but does not cover the ##funktionsweise## of the underlying
|
||
|
ODBC function call in detail. Microsoft's ODBC API reference
|
||
|
manual~\cite{BlaBla} explains all API functions in great detail.
|
||
|
|
||
|
\section{ODBC Data Types}
|
||
|
|
||
|
%%% handles
|
||
|
|
||
|
\section{ODBC functions and constants}
|
||
|
|
||
|
|
||
|
\section{Error handling}
|
||
|
|
||
|
\section{Restrictions}
|
||
|
|
||
|
|