Home » SQL & PL/SQL » SQL & PL/SQL » Update trigger
Update trigger [message #322625] Sun, 25 May 2008 06:10 Go to next message
hany_marawan
Messages: 195
Registered: April 2005
Location: Cairo - Egypt
Senior Member
Hello,
I Want to build database trigger on table to make it not updated.
How can I do this.

Thanks
Re: Update trigger [message #322628 is a reply to message #322625] Sun, 25 May 2008 06:31 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As usually, reading documentation might help. This is the Coding Triggers chapter of Oracle 10g database.

It will be a before update trigger, containing a single line of code: raise_application_error.

Now it is your turn; study the documentation, create a trigger and come back to post a solution (if it is successful), or to ask another question; just make sure it is a question about a specific problem, not "general" one like this one (which sounds as if you wanted someone to write it for you).
Re: Update trigger [message #322671 is a reply to message #322625] Sun, 25 May 2008 21:42 Go to previous messageGo to next message
TheSingerman
Messages: 49
Registered: April 2008
Location: Brighton, Michigan
Member
And to add to Littlefoot's advice (which is all very good) spend some time analyzing exactly what it is you are trying to do, and why a trigger is the best way to accomplish it. The standard way to "unupdate" a table is to issue a rollback. Works 100% of the time. You are saying that a rollback will not work in your situation. Which suggests strongly that you have a situation where, if you don't know exactly what you are doing, you will really corrupt your database.
Re: Update trigger [message #322761 is a reply to message #322625] Mon, 26 May 2008 03:07 Go to previous message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
Why don't you grant only SELECT privs on that table to users?
Previous Topic: Update record Snapshot
Next Topic: help with cursor
Goto Forum:
  


Current Time: Thu Dec 08 00:01:35 CST 2016

Total time taken to generate the page: 0.23970 seconds