Working with Databases (Embedded SQL Guide)
From InterBase
Go Up to Embedded SQL Guide
This chapter describes how to use SQL statements in embedded applications to control databases. There are three database statements that set up and open databases for access:
SET DATABASE
declares a database handle, associates the handle with an actual database file, and optionally assigns operational parameters for the database.SET NAMES
optionally specifies the character set a client application uses forCHAR
,VARCHAR
, and text Blob data. The server uses this information to transliterate from a database’s default character set to the client’s character set onSELECT
operations, and to transliterate from a client application’s character set to the database character set onINSERT
andUPDATE
operations.CONNECT
opens a database, allocates system resources for it, and optionally assigns operational parameters for the database.
All databases must be closed before a program ends. A database can be closed by using DISCONNECT
, or by appending the RELEASE
option to the final COMMIT
or ROLLBACK
in a program.
Topics
- Declaring a Database
- Specifying a Connection Character Set
- Opening a Database
- Accessing an Open Database
- Differentiating Table Names
- Closing a Database