Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS forUNIX SQL Reference - NCR

NCR Teradata RDBMS forUNIX SQL Reference - NCR, 1997. - 913 p.
Download (direct link): teradataforunix1997.pdf
Previous << 1 .. 148 149 150 151 152 153 < 154 > 155 156 157 158 159 160 .. 241 >> Next


• D and B remains the same.

• The available number of bytes, however, is increased by 50 (that is, if databases C and F were dropped, the bytes allocated to C and F are transferred to database D).

The following statement may be used to transfer ownership of the Example Finance database from user Administrator to user Chin.

GIVE Finance TO Chin;

8-150

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

GRANT

GRANT

The GRANT statement has three forms which differ in function and syntax:

• GRANT (SQL) pertaining to access control Teradata RDBMS database objects, and

• GRANT (MONITOR) for performance monitoring of the Teradata RDBMS.

The MONITOR-related GRANT statement grants system-wide performance monitoring privileges.

• GRANT LOGON

Teradata RDBMS for UNIX SQL Reference

8-151
Teradata SQL Syntax Guide

GRANT Statement (SQL)

GRANT Statement (SQL)

Function

The GRANT statement (SQL) assigns one or more privileges on a database, user, table, view, or macro to a user or a group of users.

Syntax

GRANT-

-ALL-

T

PRIVILEGES-

Lall but-I

- operation-

ON-

---dbname------

— dbname.objname — -----objname-----

TO

I-------1— username

L ALL-1

PUBLIC -

FF07B055

8-152

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

GRANT Statement (SQL)

where:

Syntax Element... Description
ALL [PRIVILEGES] Grants to the specified user all privileges, that can be granted on the specified object. To include the ability to GRANT, use the WITH GRANT OPTION clause. • Monitor privileges must be granted with a separate statement. In previous releases, GRANT ALL meant that the user had to have ALL of the appropriate privileges with the privilege to grant them, or else an error would be returned. GRANT ALL now means that ALL privileges owned by the grantor, WITH GRANT OPTION, that would pertain to the type of object, are granted. • An error is returned if the grantor has no privileges WITH GRANT OPTION on the object.
privilege Is one of the following: CHECKPOINT CREATE DATABASE CREATE MACRO CREATE TABLE CREATE USER CREATE VIEW database DELETE DROP DATABASE, MACRO, TABLE, USER DROP VIEW DUMP EXECUTE INDEX INSERT MACRO REFERENCES [col_name_list or ALL BUT... col_name_list] RESTORE rollback database ROLLFORWARD DATABASE SELECT table UPDATE [col_name_list or ALL BUT... col_name_list] USER VIEW

Teradata RDBMS for UNIX SQL Reference

8-153
Teradata SQL Syntax Guide

GRANT Statement (SQL)

Syntax Element... Description
ANSI SQL supports only SELECT, INSERT, UPDATE, DELETE and REFERENCES as privileges. The other privileges are Teradata RDBMS extensions to ANSI SQL. UPDATE and REFERENCES have table and column level options. See also Usage Notes. The recipient of such a privilege can execute the corresponding statement against the object on which the privilege was granted. If Userl receives the CREATE TABLE privilege on database DbTest, User1 can then execute a CREATE TABLE statement in which the new table is directed to DBTest (where the target database is resolved implicitly, as determined by Userl’s default database, or explicitly with a fully qualified table name.) The privileges that do not correspond to an SQL statement are DATABASE, MACRO, TABLE, USER, VIEW, DUMP, and RESTORE. If the DATABASE, MACRO, TABLE, USER, or VIEW keyword is specified without CREATE or DROP, both CREATE and DROP are assumed by default. The CHECKPOINT privilege refers to the execution of both the SQL statement and the Host Utilities (HUT) command. The DUMP and RESTORE privileges refer to the corresponding HUT command executed on the specified object. RESTORE also refers to execution of the HUT commands ROLLBACK, ROLLFORWARD, and DELETE JOURNAL.
ALL BUT Grants to the specified user all privileges that may be granted on the specified object except for those specified in the privilege list. As in ALL, only those privileges, which the grantor owns WITH GRANT OPTION are granted. ALL BUT is a Teradata RDBMS extension to ANSI SQL. Granting on a database or user is not ANSI, it is a Teradata RDBMS extension to ANSI SQL.
ON Introduces the clause that specifies the object-name on which privileges are to be granted.
dbname Specifies the name of a database or user on which the privileges are to be granted. All objects in this database or user space are affected.
dbname.objname Specifies the name of the owning database and the name of the object (table, view, or macro) on which the privileges are to be granted. Only the named object is affected.

8-154

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

GRANT Statement (SQL)

Syntax Element... Description
objname Specifies the name of the object (table, view, or macro) on which the privileges are to be granted. The resolver checks for matching database names before checking for object names. If a database and a table have the same name, unpredictable results may occur.
Previous << 1 .. 148 149 150 151 152 153 < 154 > 155 156 157 158 159 160 .. 241 >> Next