Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hello every body

I have an oracle/plsql function consisting of multiple blocks of code. Each block makes modifications in a specific part of the database tables. I need to make all of those parts as a whole ... either it is executed all or none of it is executed (for example no modifications in the tables are done until all the parts are executed successfully , otherwise in case of some error or exception happens no modifications are done). Is there anyway to implement this principle automatically by the DBMS ?

thanks in advance ...
Posted

1 solution

What you are after is Transactions[^]. You usually begin a transaction and do all the stuff you need to to do: UPDATE, INSERT etc. and only after you're done and everything was successful you do a commit. In case of error at any stage in the process you do a rollback and everything looks as if you had never touched it. :)

Regards,

— Manfred
Here another source that explaind Commit and Rollback: What is commit and rollback?[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900