Hitachi

Hitachi Advanced Database SQL Reference


3.6.1 Specification format and rules for the CREATE SCHEMA statement

The CREATE SCHEMA statement defines a schema.

Organization of this subsection

(1) Specification format

CREATE-SCHEMA-statement ::= CREATE SCHEMA [schema-name]

(2) Explanation of specification format

[Figure] schema-name

Specifies the name of the schema to be defined. In schema-name, specify the authorization identifier of the current user (the HADB user whose authorization identifier is currently connected to the HADB server).

If the schema name is omitted, the assumed value is the authorization identifier of the HADB user who executed the CREATE SCHEMA statement.

For rules on specifying a schema name, see (1) Schema name specification format in 6.1.5 Qualifying a name.

Note that you cannot specify ALL, HADB, MASTER, or PUBLIC for schema-name.

(3) Privileges required at execution

To execute the CREATE SCHEMA statement, the CONNECT privilege and schema definition privilege are required.

(4) Rules

  1. Each HADB user can own only one schema.

  2. You can only define a schema for the current user (the HADB user whose authorization identifier is currently connected to the HADB server). You cannot define a schema for another HADB user. For example, if the adbsql command is executed with ADBUSER01 specified as the authorization identifier, schema ADBUSER01 is the only schema that can be defined with CREATE SCHEMA.

(5) Examples

Example

Define a schema with the schema name ADBUSER01.

CREATE SCHEMA "ADBUSER01"