Working with Databases (Embedded SQL Guide)
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 DATABASEdeclares a database handle, associates the handle with an actual database file, and optionally assigns operational parameters for the database.
SET NAMESoptionally specifies the character set a client application uses for
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 on
SELECToperations, and to transliterate from a client application’s character set to the database character set on
CONNECTopens 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
ROLLBACK in a program.
- Declaring a Database
- Specifying a Connection Character Set
- Opening a Database
- Accessing an Open Database
- Differentiating Table Names
- Closing a Database