data type
Library: Database access (OMDB)
Import : omdb.xmd |
The db.database
data type allows you to use either your existing ODBC-compliant software drivers or
your Oracle client drivers to create a connection to and manipulate a database.
Within your program, you can create as many instances of the db.database
data type as you require by
declaring global
and local
shelves of type db.database
.
Creating and discarding instances of type db.database
is accomplished using the following functions:
db.open-odbc
-- make a connection to an ODBC compliant database.
db.open-oci11g
-- make a connection to an Oracle database using an Oracle 11g client
installation.
db.close
-- close an existing database connection.
db.database
are used as parameters by the following OMDB library functions:
db.set-transaction-type
-- set the mode of a database connection to either auto-commit or
manual-commit.
db.commit
-- commit all the insert, delete, or update operations performed since the last
db.commit
or db.rollback
.
db.execute-in
-- execute a single SQL statement on the specified database.
db.open-procedure
-- open a connection to a procedure store in the specified database.
db.query
-- execute a single SQL query on the specified database.
db.rollback
-- roll back (cancel) all operations not yet committed to the database.
db.compile-statement
-- compile an SQL statement.
db.open-table
-- open a connection to a table in a connected database.
Once you have declared a shelf of type db.database
, you can use it with one of the database open
functions (such as db.open-odbc
) in the OMDB library to create connections to databases.
import "omdb.xmd" prefixed by db. process local db.database d set d to db.open-odbc "MyDatabase"
Assuming that no errors occur when establishing the connection to the database, you can now manipulate the data in that database using the other functions in the OMDB library.