Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site


CREATE SCHEMA


Creates a new schema.



where schema-name-clause is:



and schema-element is:



Usage

Embedded/Interactive/ODBC/JDBC.

Description

A new schema is created with the name specified in schema-name-clause. If schema-name is specified, the schema is created with that name, otherwise the name of the schema will be the same as ident-name.

If ident-name is specified, the schema and all the other objects created by the CREATE SCHEMA statement are created with the named ident as the effective current ident.

A schema-element is a CREATE or GRANT statement that is specified using the normal syntax for such a statement and which is executed by the CREATE SCHEMA statement in the normal way.

Language Elements

create-collation-statement, see CREATE COLLATION.

create-domain-statement, see CREATE DOMAIN.

create-index-statement, see CREATE INDEX.

create-sequence-statement, see CREATE SEQUENCE.

create-synonym-statement, see CREATE SYNONYM.

create-table-statement, see CREATE TABLE.

create-view-statement, see CREATE VIEW.

grant-statement, see GRANT ACCESS PRIVILEGE or GRANT OBJECT PRIVILEGE.

Restrictions

The schema name must not be the same as that of a schema which already exists in the database.

CREATE SCHEMA requires that the current ident has SCHEMA or IDENT privilege.

The value for ident-name is currently restricted to be the name of the current ident.

A grant-statement is restricted to GRANT ACCESS PRIVILEGE, GRANT USAGE ON DOMAIN or GRANT USAGE ON SEQUENCE (i.e. it is only possible to grant privileges on private database objects).

If a schema-element contains a CREATE statement where the name of the object to be created is specified in its fully qualified form (i.e. schema_name.object_name), the schema-name component must be the same as the name of the schema being created by the CREATE SCHEMA statement.

Notes

If a schema-element contains a CREATE statement where the name of the object to be created is specified in an unqualified form, it will be created in the schema created by the CREATE SCHEMA statement (and not the schema with the same name as the current ident as is usual for CREATE statements).

It is possible for one schema-element to reference the objects created by other schema-element's regardless of the order of creation of the objects. All object references are verified at the conclusion of the CREATE SCHEMA statement when all the schema-element's have been executed and all objects have been created.

Example

 CREATE SCHEMA mimer_store_music;
 

For more information, see the Mimer SQL User's Manual, Creating Idents and Schemas.

Standard Compliance

Standard
Compliance
Comments
SQL-2011
Core
Fully compliant.
SQL-2011
Features outside core
Feature F690, "Collation support" support for CREATE COLLATION statement in schema definition.
Feature F251, "Domain support" support for CREATE DOMAIN statement in schema definition.
Feature F171, "Multiple schemas per user" support for schema name-clause.

Mimer SQL extension
Support for CREATE INDEX and CREATE SYNONYM statements in a schema definition is a Mimer SQL extension.


Mimer
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
info@mimer.se
Mimer SQL Documentation TOC PREV NEXT INDEX