Next Previous Up Top Contents Index

14.2 Initialization

14.2.3 Initialization functions and variables

Note: Check the Release Notes for up-to-date information about supported database systems and their keywords.

The generic SQL interface code, including the SQL package itself, and the appropriate libraries, are load-on-demand. The initialization of the chosen database type is achieved by calling sql:initialize-database-type on that database-type. First, generic code for the SQL interface is loaded, then class-specific code and the appropriate database libraries. The library loading is controlled by examination of environment variables, which should be set accordingly.

The following functions and variables are relevant to initialization:

*default-database-type*

Variable

Specifies the default type of database. If this variable is set, thensql:init-sql may callsql:initialize-database-type.
*initialized-database-types*

Variable

Contains a list of database types which have been initialized by calls toinitialize-database-type.
initialize-database-type

Function

sql:initialize-database-type &key database-type

Initializes a database type by loading code and appropriate database libraries according to the value of database-type. Adds database-typeto the list of initialized types. Thesql package itself is loaded during the first call to this function. This function is called bysql:init-sql ifsql:*default-database-type* is set.
A sample code sequence for initializing SQL to work with an ODBC database, using the above functions and variables, is as follows:
(require "odbc")
(in-package "sql")
(setf *default-database-type* :odbc)
(initialize-database-type)


LispWorks User Guide - 14 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker