schema
is the name of the schema. The schema name must be the same as your Oracle7 username.
CREATE TABLE command
is a CREATE TABLE statement to be issued as part of this CREATE SCHEMA statement
CREATE VIEW command
is a CREATE VIEW statement
to be issued as part of this CREATE SCHEMA statement. See the CREATE VIEW command .
GRANT command
is a GRANT statement (Objects Privileges) to be issued as part of this CREATE SCHEMA statement. See the GRANT command .
The CREATE SCHEMA statement only supports the syntax of these commands as defined by standard SQL, rather than the complete syntax supported by Oracle7. For information on which parts of the syntax for these commands are standard SQL and which are Oracle7 extensions, see Appendix B of this manual.
Terminate a CREATE SCHEMA statement just as you would any other SQL statement using the terminator character specific to your tool. For example, if you issue a CREATE SCHEMA statement in SQL*Plus or Server Manager, terminate the statement with a semicolon (;). Do not separate the individual statements within a CREATE SCHEMA statement with the terminator character.
The order in which you list the CREATE TABLE, CREATE VIEW, and GRANT statements is unimportant:
Example
The following statement creates a schema named BLAIR for the user BLAIR:
CREATE SCHEMA AUTHORIZATION blair CREATE TABLE sox (color VARCHAR2(10) PRIMARY KEY, quantity NUMBER) CREATE VIEW red_sox AS SELECT color, quantity FROM sox WHERE color = 'RED' GRANT select ON red_sox TO waites
The following statement creates the table SOX, creates the view RED_SOX, and grants SELECT privilege on the RED_SOX view to the user WAITES.