Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Oracle
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 18-Feb-13 4:25am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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. Smile | :)
 
Regards,
 
— Manfred

Here another source that explaind Commit and Rollback: What is commit and rollback?[^]
  Permalink  

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

  Print Answers RSS
0 Abhinav S 155
1 Mika Wendelius 151
2 Sergey Alexandrovich Kryukov 135
3 TheRealSteveJudge 114
4 Peter Leow 110
0 Sergey Alexandrovich Kryukov 8,613
1 OriginalGriff 6,536
2 Peter Leow 3,727
3 Zoltán Zörgő 3,456
4 Richard MacCutchan 2,442


Advertise | Privacy | Mobile
Web03 | 2.8.150123.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100