Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Oracle trigger

Posted on 2011-02-10
10
Medium Priority
?
505 Views
Last Modified: 2012-08-14
How to  prevent insert/update/delete trigger in oracle
0
Comment
Question by:poznan
10 Comments
 

Author Comment

by:poznan
ID: 34868199
Oracle
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 34868210
do you want to prevent the creation of a trigger?

if so,  remove the "create trigger" privilege from the user.

If you want to stop the execution of a trigger, disable it


alter trigger yourschema.yourtrigger disable;

0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 2000 total points
ID: 34868215
if you want to block execution conditionally, that is, run it sometimes and ignore it others,  you can't.

but you could instead put conditions inside the trigger so that when it runs it might not do anything sometimes.

for example... this trigger would insert a row into another table but only if the current user is me


CREATE OR REPLACE TRIGGER sample_trigger
BEFORE UPDATE
ON sample_table
FOR EACH ROW
BEGIN
   if user = 'SDSTUBER' then
             insert into some_other_table (a,b,c) values(1,2,3);
   end if;
END ;
/
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 15

Expert Comment

by:Aaron Shilo
ID: 34933504
>> How to  prevent insert/update/delete trigger in oracle

please explain yourself .
0
 
LVL 1

Expert Comment

by:maheshchari
ID: 34933906
in oracle there no insert tiger,delete tiger
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34934021
maheshchari,

The question isn't about "tigers", it's about TRIGGERS, and Oracle most certainly DOES have insert and delete triggers
0
 
LVL 1

Expert Comment

by:daddyhaw
ID: 34934982
yo can disable all triggers on a table with the following command

alter table mytable disable all triggers;

this will disbale all the update,insert,delete triggers from firing
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34975688
With a closing comment of "it helps"  it seems like useful information was given

I recommend

Split of

http:#34868210
http:#34868215


The other comments are either asking for input, wrong or duplicate information
0
 

Expert Comment

by:modus_in_rebus
ID: 35067583
poznan,

Since you haven't taken proper action to close this question, I'll go ahead and close it myself by following the expert's recommendation.

modus_in_rebus
Community Support Moderator
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question