Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

commit and rollback

Former Member
0 Likes
368

Hi,

I have four tables..One by one am inserting the values to tht tables from internal tables..

insert <tab name> from table <int table name>.

after i inserted in the 3rd table,it goes to insert in the fourth table.There if it already have the key field means it is throwing error..at the same time i need to rollback the insertion which was happened in the previous 3 tables..

how to do this..whether we need to use any commit orr rollback

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
343

hi there...

wat u can do is, on getting an error, apply the delete command one by one on the previous three tables...

or do one thing, while initially inserting into the first three tables, applly a join with the fourth table and check b4 insertion whether that value is already present in the fourth table or not... so that only those values are inserted which are not present in the fourth table. this way, the over head of inserting and deleting will be gone....

i think this should help. do reward if it does.... or get back with further queries.

2 REPLIES 2
Read only

Former Member
0 Likes
344

hi there...

wat u can do is, on getting an error, apply the delete command one by one on the previous three tables...

or do one thing, while initially inserting into the first three tables, applly a join with the fourth table and check b4 insertion whether that value is already present in the fourth table or not... so that only those values are inserted which are not present in the fourth table. this way, the over head of inserting and deleting will be gone....

i think this should help. do reward if it does.... or get back with further queries.

Read only

0 Likes
343

r u saying tht we want to use selet wuery before inserting..