Quadcap Software

Quadcap Embeddable Database

Quadcap Software

Syntax

createSchemaStmt
  :  "create" "schema" 
    (  sqlId 
      (  "authorization" sqlId 
      |  
      ) 
    |  "authorization" sqlId 
    ) 
    ( schemaStatement )* 
  ;


CREATE SCHEMA Statement

This statement creates a schema, a set of named tables, views, indexes, etc., owned by a particular user. By default, all tables and views are created in the schema associated with the authorization id specified in the getConnection call.

The CREATE SCHEMA statement may include a series of statements, which may create a set of objects in the schema.

Examples

CREATE SCHEMA CAROL
CREATE TABLE NAMES(N VARCHAR(80), I INT PRIMARY KEY WITH IDENTITY)
CREATE UNIQUE INDEX NAMEINDEX ON NAMES(N);

Implementation Notes

  • The standard specifies that constraints associated with the sub-statements that are part of the CREATE SCHEMA statement are deferred until the end, so that situations which would otherwise not be possible, such as circular foreign key constraints, can be handled. The current version of the driver does not defer such constraint checks.
  • It's also worth noting that the there really is no database object corresponding to a schema, per se. It's just a prefix or a scope associated with table and view names.