from reference manual
create schema
Description
Creates a new collection of tables, views, and permissions for a database
user.
Syntax
create schema authorization authorization_name
create_oject_statement
[ create_object_statement ... ]
[ permission_statement ... ]
Parameters
authorization_name
must be the name of the current user in the database.
create_object_statement
is a create table or create view statement.
permission_statement
is a grant or revoke command.
Examples
Example 1
Creates the newtitles, newauthors, newtitleauthors tables, the tit_auth_view
view, and the corresponding permissions:
create schema authorization pogo
create table newtitles (
title_id tid not null,
title varchar(30) not null)
create table newauthors (
au_id id not null,
au_lname varchar(40) not null,
au_fname varchar(20) not null)
create table newtitleauthors (
au_id id not null,
title_id tid not null)
create view tit_auth_view
as
select au_lname, au_fname
from newtitles, newauthors,
newtitleauthors
where
newtitleauthors.au_id = newauthors.au_id
and
newtitleauthors.title_id =
newtitles.title_id
grant select on tit_auth_view to public
revoke select on tit_auth_view from churchy
Usage
·Schemas can be created only in the current database.
·The authorization_name, also called the schema authorization identifier,
must be the name of the current user.
·The user must have the correct command permissions (create table and/or
create view). If the user creates a view on tables owned by another database
user, permissions on the view are checked when a user attempts to access
data through the view, not when the view is created.
·The create schema command is terminated by:
·The regular command terminator ("go" is the default in isql).
·Any statement other than create table, create view, grant, or revoke.
·If any of the statements within a create schema statement fail, the entire
command is rolled back as a unit, and none of the commands take effect.
·create schema adds information about tables, views, and permissions to the
system tables. Use the appropriate drop command (drop table or drop view) to
drop objects created with create schema. Permissions granted or revoked in a
schema can be changed with the standard grant and revoke commands outside
the schema creation statement.
Standards
Standard
Compliance Level
SQL92
Entry level compliant
Permissions
create schema can be executed by any user of a database. The user must have
permission to create the objects specified in the schema; that is, create
table and/or create view permission.
Post by Kim ThaiHi,
Can someone help to define the term "schema" in sybase? Does it have the
same mean as in Oracle? To me "schema" simply means the database DDL
script for creating a specific database structure. I am working with
someone who has Oracle back ground and keep persuade me to create a db
using "create schema" command in ASE. I am not sure what is the benefit
of using "create schema". I cannot find much document about this. I
appreciate any of your replies.