Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to prevent trigger recursive?

Re: How to prevent trigger recursive?

From: steve <E_at_E.COM>
Date: Fri, 23 Feb 2001 07:02:04 +0800
Message-ID: <1ep9rjn.1069peh7om4caN%E@E.COM>

Hi,
what exactly are you trying to do, why is the trigger re-firing internally if you are using the old/new variable names system.?

if it is simpily to stop a trigger from re-firing until you have exited the code then why not:

 create or replace trigger tri_RenameDir

    before Update on DocIndex
  begin
 if check_lock() =0
set_lock(1)
......do action here
set_lock(0)
else
exit
end if
exeption section
set_lock(0)
exit

package
define global lock_flag1

function check_lock()
return number

return lock_flag1

procedure set_lock(state in number)
lock_flag1=state
return

steve

Diviner <diviner_at_hknet.com> wrote:

> I know the difference between DDL and DML. But I haven't other way
> to prevent the action trigger again in case the trigger handling will
> raise up itself
> again.
>
> I have no alternative to do this trying.
>
> Sybrand Bakker wrote:
>
> > On Thu, 22 Feb 2001 14:21:42 +0800, Diviner <diviner_at_hknet.com> wrote:
> >
> > >I tried to place a Disable clause inside but failed to compile, like
> > >this:
> > > ******************************
> > > create or replace trigger tri_RenameDir
> > > before Update on DocIndex
> > > begin
> > > alter trigger tri_RenameDir disable;
> > > ....
> > > alter trigger tri_RenameDir enable;
> > > end;
> > > ******************************
> > >
> > >So how to do that? Thank you very much.
> > alter trigger is DDL, so you need execute immediate or dbms_sql to
> > process this.
> > Do you think this is going to work? Do you want to disable the trigger
> > you are calling at the same moment?
> >
> > Please try to read the Oracle Application Developers Guide. Why do you
> > think you can do without?
> >
> > Regards,
> >
> > Sybrand Bakker, Oracle DBA
Received on Thu Feb 22 2001 - 17:02:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US