--> Sayadasite: TCL COMMANDS

Multiple Ads

Search

Menu Bar

TCL COMMANDS

 TCL COMMANDS(transaction control language)

It control the transaction of database

It has three commands

commit rollback and savepoint

syntax:

commit;

rollback;

savepoint savepoint name;

 select *from player;

RANK

NAME

SCORE

1

virat

183

2

dhoni

183

3

rohit

264

Update player set name=’kohli’ where rank=1;

1 row updated

select * from player;

RANK

NAME

SCORE

1

kohli

183

2

dhoni

183

 rollback;

rollback completed

select * from player;

 

RANK

NAME

SCORE

1

virat

183

2

dhoni

183

Update player set name=’kohli’ where rank=1;

1 row updated

select * from player;

RANK

NAME

SCORE

1

kohli

183

2

dhoni

183

 rollback;

rollback completed

select * from player;

RANK

NAME

SCORE

1

virat

183

2

dhoni

183

 Delete from player where rank=1;

1 row deleted

select * from player;

RANK

NAME

SCORE

2

dhoni

183

Rollback;

rollback completed

select * from player;

RANK

NAME

SCORE

1

virat

183

2

dhoni

183

 SAVEPOINT

select * from player;

RANK

NAME

SCORE

1

virat

183

2

dhoni

183

Save point A;

Save point created

Insert into player values(3,’dhawan’,143);

1 row created

Insert into player values(4,’sachin’,100);

1 row created

Insert into player values(5,’pandya’,108);

 rollback to B;

rollback complete

select * from player;

RANK

NAME

SCORE

1

virat

183

2

dhoni

183

3

Dhawan

143

4

Sachin

100

5

pandya

108

 

 

No comments: