Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > C

CREATE SCHEMA (Short Name: CRE SCH)

Scroll Prev Top Next More

Use the CREATE SCHEMA command to name a database and assign a user identifier for the database owner.

 

CREATESC

 

Options

 

AUTHORIZATION dbname

Specifies the name of the database.

 

ownername

Allows you to assign a unique identifier for the owner of the database.

 

About the CREATE SCHEMA Command

A database name is limited to 128 characters. The database name must begin with a letter, and can contain letters, numbers, and the following symbols: number or pound sign (#), dollar sign ($), underscore (_),or percent sign (%). A database name cannot contain blanks or have a file extension, and must follow the naming conventions for R:BASE and the operating system.

 

R:BASE creates four database files with extensions: .RX1, .RX2, .RX3, and .RX4. After you name a database, you need to use other commands to define the tables, views, rules, and access rights for the database.

 

Assigning A Database Owner's User Identifier

A database owner's user identifier must begin with a letter and can contain letters, numbers, and the and the following symbols: number or pound sign (#), dollar sign ($), underscore (_),or percent sign (%). If user identifiers are assigned to users, the database owner's user identifier must be unique among all user identifiers in the database. A database owner's user identifier can be a maximum of 128 characters.

 

If you do not specify a user identifier, R:BASE assigns the default user identifier, PUBLIC. Until a user identifier is assigned, anyone can modify the database structure, read, enter, change, or delete data. When an owner's user identifier is assigned to a database, the database is accessible only by the owner. To give other users access rights to the database, use the GRANT command.

 

You do not have to assign a user identifier when the database is created. To assign a user identifier after the database has been created, use the RENAME OWNER command or the Utilities: User Privileges... menu option.

 

CREATE SCHEMA stores the owner's case folding and collating tables from the configuration file in the database. Be sure to keep a record of the owner's user identifier in a safe place away from your computer. If you lose the owner's identifier, you cannot search the database to find it.

 

Building a Database

You can use CREATE SCHEMA and other CREATE commands as an alternative to creating a new database using the menu options in R:BASE for Windows.

 

When you run the CREATE SCHEMA command, R:BASE closes the currently open database (if one exists), then defines and opens a new database.

 

Transaction Processing and the CREATE SCHEMA Command

If transaction processing is on when you enter a CREATE SCHEMA command, R:BASE first commits your current transaction (if any), then creates and connects you to the database. Transaction processing is on in the database, but you cannot reverse the CREATE SCHEMA command.

 

Example

 

The following command names the finance database and assigns jane as the database owner's user identifier.

 

CREATE SCHEMA AUTHORIZATION finance jane