Declaring and Initializing Databases

From InterBase

Go Up to Application Requirements

A SQL program can access multiple InterBase databases at the same time. Each database used in a multiple-database program must be declared and initialized before it can be accessed in SQL transactions. Programs that access only a single database need not declare the database or assign a database handle if, instead, they specify a database on the gpre command line.

DSQL programs cannot connect to multiple databases.

InterBase supports the following SQL statements for handling databases:

  • SET DATABASE declares the name of a database to access, and assigns it to a database handle.
  • CONNECT opens a database specified by a handle, and allocates it system resources.

Database handles replace database names in CONNECT statements. They can also be used to qualify table names within transactions. For a complete discussion of database handling in SQL programs, see Working with Databases.


Advance To: