Creates a new view.
create view [database_name.][owner.]view_name [(column_name [, column_name]...)] as select [distinct] select_statement [with check option]
is the name of the view. The view name cannot include the database name. It must conform to the rules for identifiers.
is the name of the column in the view. It must conform to the rules for identifiers.
begins the select statement that defines the view.
specifies that the view cannot contain duplicate rows (optional).
completes the select statement that defines the view. It can include more than one table and other views.
indicates that all data modification statements are validated against the view selection criteria. All rows inserted or updated through the view must remain visible through the view.
The following example creates the new view from old view.
create view new_view (col1, col2) as select col1, col2 from old_view
You can use views as security mechanisms by granting authorization on a view but not on its underlying tables.
Copyright © 2005. Sybase Inc. All rights reserved. |