Creating a Database (Creating Metadata)

From InterBase
Jump to: navigation, search

Go Up to Creating Metadata


CREATE DATABASE establishes a new database and its associated system tables, which describe the internal structure of the database. SQL programs can select the data in most of these tables just as in any user-created table.

In its most elementary form, the syntax for CREATE DATABASE is:

EXEC SQL
CREATE DATABASE '<filespec>';

CREATE DATABASE must appear before any other CREATE statements. It requires one parameter, the name of a database to create. For example, the following statement creates a database named countries.ib:

EXEC SQL
CREATE DATABASE 'countries.ib';
Note: The database name can include a full file specification, including both host or node names, and a directory path to the location where the database file should be created. For information about file specifications for a particular operating system, see the operating system manuals.
Important: Although InterBase enables access to remote databases, you should always create a database directly on the machine where it is to reside.

Topics