New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Resources » Articles/Knowledge Sharing » Education »

DCL and TCL


Posted Date: 24 Oct 2009    Resource Type: Articles/Knowledge Sharing    Category: Education
Author: sherlyMember Level: Silver    
Rating: 3 out of 53 out of 53 out of 5Points: 2



DATA CONTROL LANGUAGE AND TRANSACTION CONTROL LANGUAGE COMMANDS


DATA CONTROL LANGUAGE COMMANDS

GRANT COMMAND:

SQL> Grant select, delete, update on employeee to public;

Grant succeeded.

REVOKE COMMAND:

SQL> Revoke select, delete, update on employeee from public;

Revoke succeeded.


TRANSACTION CONTROL LANGAUAGE COMMANDS

SAVEPOINT COMMAND:

SQL> Select * from employeee;

ENO ENAME AGE SALARY DOJ
--------- --------------- --------- --------- ---------
100 preethi 29 66666.66 28-JAN-00
101 swathi 30 66655.55 20-DEC-99
102 deepika 28 54432.22 20-FEB-01
104 aarthi 32 55423.44 15-SEP-02

SQL>Insert into employeee values (105,'aaaaa', 20,2303.03,'20-jul-05');

1 row created.

SQL> Savepoint A;

Savepoint created.

SQL> Update employeee set ename='ppppp' where age=30;

1 row updated.

SQL> Savepoint B;

Savepoint created.

SQL> Update employeee set ename='kkkkkk' where age=28;

1 row updated.

SQL> Savepoint C;

Savepoint created.

SQL> Select * from employeee;

ENO ENAME AGE SALARY DOJ
--------- --------------- --------- --------- ---------
100 preethi 29 66666.66 28-JAN-00
101 ppppp 30 66655.55 20-DEC-99
102 kkkkkk 28 54432.22 20-FEB-01
104 aarthi 32 55423.44 15-SEP-02
105 aaaaa 20 2303.03 20-JUL-05


ROLLBACK COMMAND:

SQL> Rollback to B;

Rollback complete.

SQL> Select * from employeee;

ENO ENAME AGE SALARY DOJ
--------- --------------- --------- --------- ---------
100 preethi 29 66666.66 28-JAN-00
101 ppppp 30 66655.55 20-DEC-99
102 deepika 28 54432.22 20-FEB-01
104 aarthi 32 55423.44 15-SEP-02
105 aaaaa 20 2303.03 20-JUL-05


SQL> Rollback to A;

Rollback complete.

SQL> Select * from employeee;



ENO ENAME AGE SALARY DOJ
--------- --------------- --------- --------- ---------
100 preethi 29 66666.66 28-JAN-00
101 swathi 30 66655.55 20-DEC-99
102 deepika 28 54432.22 20-FEB-01
104 aarthi 32 55423.44 15-SEP-02
105 aaaaa 20 2303.03 20-JUL-05

SQL> Rollback to B;
Rollback to B
*
ERROR at line 1:
ORA-01086: Savepoint 'B' never established

COMMIT COMMAND;

SQL> Select * from employeee;

ENO ENAME AGE SALARY DOJ
--------- --------------- --------- --------- ---------
100 preethi 29 66666.66 28-JAN-00
101 swathi 30 66655.55 20-DEC-99
102 deepika 28 54432.22 20-FEB-01
104 aarthi 32 55423.44 15-SEP-02
105 aaaaa 20 2303.03 20-JUL-05

SQL> Insert into employeee values (110,'lllll', 45,1230.12,'16-jan-06');
1 row deleted.

SQL> Savepoint E;

Savepoint created.

SQL> Delete from employeee where eno=101;

SQL> Savepoint F;
Savepoint created.

SQL> Commit;

Commit complete.
SQL> Rollback to E;
*
ERROR at line 1:
ORA-01086: savepoint 'E' never established




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
DCL and TCL  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Dml
Previous Resource: Design of a Naturalistic Gesture Based Input Appliance
Return to Discussion Resource Index
Post New Resource
Category: Education


Post resources and earn money!
 
More Resources



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.