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

Home -> Community -> Usenet -> c.d.o.server -> Re: Get the table name in a trigger

Re: Get the table name in a trigger

From: Pendragon <pendragony_at_geocities.com>
Date: 1998/08/26
Message-ID: <01bdd123$38ea9480$96b9d5d0@yesford.btg.com>#1/1

You could also get the name of the table a trigger is defined on from the all_triggers table. This would mean hard coding the trigger name in the trigger. Also since in defining the trigger you have to hard code the table name, what purpose is served by dynamically deterring the name of the table the trigger is defined on?

Michael Krolewski <vandra_at_u.washington.edu> wrote in article <35E3AA65.6A25DE4C_at_u.washington.edu>...
> I believe the question is answered with dynamic SQL.
>
> The dynamic SQL package (dbms_sql ) allows for the construction of any
> query at runtime. Assuming that rest of the information / data is
 consistent
> one
> can transfer in the table name at runtime, construct the sql statement,
 parse
> and
> execute it.
>
> This is all in the programming manual.
>
>
> Mike Krolewski
>
> Matthew, MacFarland wrote:
>
> > Hello everyone,
> >
> > Is there a way to get the name of the table that a trigger is defined
 on
> > from within the trigger code at run time?
> >
> > Each of the triggers in the application I am working on calls a
 procedure
> > which takes the table name as a parameter and I am trying to find a way
 to
> > avoid hard coding the table names in all the triggers.
> >
> > Thanks,
> >
> > Matthew MacFarland
> > Dril-Quip, Inc.
>
>
>
>
Received on Wed Aug 26 1998 - 00:00:00 CDT

Original text of this message

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