Defining a Database
Following the Introduction, this section describes in details how to create a database in RDM 14.
RDM databases are defined using the Database Definition Language (DDL) specified by the ISO/ANSI SQL Standard. This SQL-based RDM DDL is used to define a database both for an RDM native (non-SQL) application and for an SQL/ODBC, JDBC or ADO .NET. application.
Your initial database definition will consist of at least one or more CREATE TABLE statements. If you issue your DDL statements through an SQL interface, such as the
rdm-sql tool, the first DDL statement must be the CREATE DATABASE statement in order to identify the name of the new database.
If you use either of the two RDM utilities,
rdm-create, to submit your DDL statements, you cannot use CREATE DATABASE to specify the database name. Instead, the database name is derived from the name of the schema definition file that contains your DDL specification. DDL statements issued through
rdm-create are not transactional. The database definition becomes permanent once the utility successfully completes.
RDM database names are case-sensitive. It means two schema definition files whose names differ only in case, such as my_db.sdl and MY_DB.sdl, will become two separate databases,
MY_DB. In SQL, the database name specified in CREATE DATABASE will automatically be stored in all-uppercase according to the SQL Standard. In order to preserve the case, you need to enclose the database name in double-quotes. For example,
CREATE DATABASE my_db will produce
CREATE DATABASE "my_db" will produce
A summary of all of the DDL statements is provided in the following table. Detailed descriptions can be found by clicking on the DDL statement name.
|CREATE DATABASE||(SQL only) Initiates a database definition transaction. Subsequent DDL statements define the database followed by a COMMIT, which completes the DDL and installs the database on the TFS.|
|CREATE TABLE||Creates a new database table.|
|CREATE INDEX||Creates a new key (index) to an existing table.|
|DROP DATABASE||Deletes a database—both the content and definition of the database are irrevocably deleted.|