1.0

Table Of Contents
If the underlying objects that the view references are not owned by the view owner, the view owner must be
granted the appropriate privileges. For example, if the authorization ID user2 attempts to create a view called
user2.v2 that references table user1.t1 and function user1.f_abs(), then user2 must have the SELECT privilege
on table user1.t1 and the EXECUTE privilege on function user1.f_abs().
The privilege to grant the SELECT privilege cannot be revoked. If a required privilege on one of the underlying
objects that the view references is revoked, then the view is dropped across the distributed system.
A view denition can contain an optional view column list to explicitly name the columns in the view. If there
is no column list, the view inherits the column names from the underlying query. All columns in a view must
be uniquely named.
Statement dependency system
View denitions are dependent on the tables and views referenced within the view denition. DML statements
that contain view references depend on those views, as well as the objects in the view denitions that the views
are dependent on. Statements that reference the view depend on indexes the view uses; which index a view uses
can change from statement to statement based on how the query is optimized.
Example
CREATE VIEW SAMPLE.V1 (COL_SUM, COL_DIFF)
AS SELECT COMM + BONUS, COMM - BONUS
FROM SAMPLE.EMPLOYEE;
CREATE VIEW SAMPLE.EMP_RES (RESUME)
AS VALUES 'Delores M. Quintana', 'Heather A. Nicholls',
'Bruce Adamson';
DECLARE GLOBAL TEMPORARY TABLE
Denes a temporary table for the current connection uniquely identied within the local member.
Syntax
DECLARE GLOBAL TEMPORARY TABLE table-name
{ column-definition [ , column-definition ] * }
[ ON COMMIT {DELETE | PRESERVE} ROWS ]
NOT LOGGED [ON ROLLBACK DELETE ROWS]
Description
The DECLARE GLOBAL TEMPORARY TABLE statement denes a temporary table for the current connection
uniquely identied in the member.
These tables do not reside in the system catalogs and are not persistent. Temporary tables exist only during the
connection that declared them and cannot be referenced outside of that connection. When the connection closes,
the rows of the table are deleted, and the in-memory description of the temporary table is dropped.
Temporary tables are useful when:
The table structure is not known before using an application.
Other users do not need the same table structure.
Data in the temporary table is needed while using the application.
The table can be declared and dropped without holding the locks on the system catalog.
469
SQL Language Reference