Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL
Expertise: Beginner
May 13, 2008

Using the GRANT Command

The SQL GRANT command is used to grant access privileges to database objects and role authorizations. For example, the following statement grants the user username the right to SELECT tabname:

GRANT SELECT ON tabname TO username
Some database vendors, such as Oracle and MySQL, have extended GRANT's abilities to create users and change existing user passwords. Indeed, prior to introduction of the CREATE USER command in Oracle 7, the only way to create a user in Oracle was to use the GRANT command:

GRANT CONNECT to username IDENTIFIED BY user_password
This combination of creating users and simultaneously assigning them database privileges eliminates the need to separately grant the required privileges to newly created users. Interestingly, the GRANT command's counterpart, REVOKE, was not extended to delete users.

Alexander Ocher
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap