Click here to Skip to main content
11,798,866 members (45,317 online)
Rate this: bad
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 3:25am

1 solution

Rate this: bad
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 | :)


— Manfred

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

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

  Print Answers RSS
0 CPallini 585
1 OriginalGriff 418
2 Maciej Los 345
3 Richard MacCutchan 281
4 Abhinav S 257
0 OriginalGriff 2,270
1 Maciej Los 1,810
2 KrunalRohit 1,496
3 CPallini 1,425
4 Richard MacCutchan 1,109

Advertise | Privacy | Mobile
Web04 | 2.8.151002.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