Solved

Oracle trigger

Posted on 2011-02-10
10
501 Views
Last Modified: 2012-08-14
How to  prevent insert/update/delete trigger in oracle
0
Comment
Question by:poznan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 

Author Comment

by:poznan
ID: 34868199
Oracle
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 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 500 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

630 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