Function
sql
connect connection-spec &key if-exists database-type => database
The connection specifications.
A keyword.
A database type.
A database.
connect function opens a connection to a database of database-type. The default value for database-type is*default-database-type*. The connection-spec depends on the type of the database to connect to. For databases of type:odbc, the connection specification is a string of the format "datasource-name/username/password"
*default-database* is set to an instance of the database opened and the instance is returned. The argument if-exists modifies the behavior ofconnect as follows: :newMakes a new connection even if connections to the same database already exist.
:warn-newMakes a new connection but warns about existing connections.
:errorMakes a new connection but signals an error for existing connections.
:warn-oldSelects old connection if one exists (and warns) or makes a new one.
:oldSelects old connection if one exists or makes a new one.
*connect-if-exists*. info database. (connect "info")
personnel using the username "admin" and the password "secret". (connect "personnel/admin/secret" :database-type :odbc)
disconnectstatusfind-databasedatabase-nameconnected-databases