Click here to Skip to main content
13,148,136 members (38,368 online)
Rate this:
Please Sign up or sign in to 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 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. :)


— 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170924.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2017
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