Working with Databases (Embedded SQL Guide)

From InterBase
Jump to: navigation, search

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 for CHAR, 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 SELECT operations, and to transliterate from a client application’s character set to the database character set on INSERT and UPDATE 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