Grant, Revoke, Commit, Delete

 

 

Grant

The basic GRANT statement, is used to grant security privileges on database objects to specific users or roles. Normally, the GRANT statement is used by the owner of a table or view to give other users access to the data the GRANT statement includes a specific list of the privileges to be granted, the name of the table or other object to which the privileges apply (an object type is required for all objects except tables and views), and the user-id or role to which the privileges are granted.

 

Syntax:

GRANT privilege_name

ON object_name

TO {user_name | PUBLIC | role_name}

 

 

 Revoke

The REVOKE statement has a structure that closely parallels the GRANT statement, specifying a specific set of privileges to be taken away, for a specific database object, from one or more user-ids.

A REVOKE statement may take away all or some of the privileges that you previously granted to a user-id.

 

Syntax: ‘

REVOKE  privilege_name

ON object_name

FROM {user_name | PUBLIC | role_name}

 

Commit

The COMMIT command executes a SQL COMMIT command. All changes made in your database session are committed,

 

COMMIT WORK;

 

 

Delete

The DELETE Statement is used to delete rows from a table.

Syntax

DELETE FROM table_name [WHERE condition];

 

 

Insert

The INSERT Statement is used to add new rows of data to a table.

 

INSERT INTO TABLE_NAME

[(col1,col2,col N)]

VALUES (val 1, val 2, val 3. . val N);

 

Lock Table

Use the LOCK TABLE statement to lock one or more tables, table partitions, or table subpartitions in a specified mode. This lock manually overrides automatic locking and permits or denies access to a table or view by other users for the duration of your operation.

 

A locked table remains locked until you either commit your transaction or roll it back, either entirely or to a savepoint before you locked the table.

 

Rollback

Use the ROLLBACK statement to undo work done in the current transaction or to manually undo the work done by an in-doubt distributed transaction.

 

Syntax:

ROLLBACK;

 

 

Save point

Use the SAVEPOINT statement to identify a point in a transaction to which you can later roll back.

Syntax:

SAVEPOINT SAVEPOINT_NAME;

 

 

update

Use the UPDATE statement to change existing values in a table or in the base table of a view or the master table of a materialized view.

Syntax:

 

UPDATE table_name
SET column1=value1,column2=value2,…
WHERE some_column=some_value;

 

 

 

Registration


A password will be e-mailed to you.

Feedback Form

Name (required)

Email (required)

Feedback