Jump to content

Data control language

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dfetter (talk | contribs) at 00:35, 1 February 2007. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A Data Control Language (DCL) is a computer language and a subset of SQL, used to control access to data in a database. Examples of DCL commands include:

  • GRANT to allow specified users to perform specified tasks.
  • REVOKE to cancel previously granted or denied permissions.

The following things can be GRANTED TO or REVOKED FROM a user or role:

  • CONNECT allows a user to connect to the database or schema.
  • SELECT allows a user to select records.
  • INSERT allows a user to insert records.
  • UPDATE allows a user to update records.
  • DELETE allows a user to delete records.
  • USAGE allows a user to use a database object such as a schema or a function

In Oracle, executing a DCL command issues an implicit commit.

In PostgreSQL, executing DCL is transactional, and can be rolled back.

See also