Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: TRIGGER-Name of the current table
Robbert van der Hoorn wrote:
> Please don't top post. See below.
> "Taras" <taras.kolakovic_at_gmail.com> schreef in bericht
> news:1160052829.467604.54000_at_c28g2000cwb.googlegroups.com...
> > Thanx for your answer, Martin,
> >
> > The main goal is to pass the original (old) record to a procedure,
> > which would then concatinate all the values from this record an store
> > them into a logging table. (i wanted to use that table name to retrieve
> > rowtype later)
> >
> > I would like to have only one procedure, which would log records from
> > many different tables.
> > (perhaps i would pass them as ref cursor, i'm not sure yet how to do
> > it, since i'm a beginner)
> >
> > The reason is that if we would decide to change the logging mechanism
> > later, we would have to change only that procedure instead of 50
> > triggers accross the schema.
> >
> > Also i would like to have this universal code, to add it to any new
> > tables without serious modifications (because our database structure
> > tends to change often)
> >
> > Regards, Taras
> >
> >
> >
> >
> > Martin T. je napisal:
> >> Taras wrote:
> >> > Hello,
> >> >
> >> > I'm fairly new at PL-SQL, so forgive mi if this question sounds
> >> > stupid...
> >> >
> >> > I'm trying to write a trigger on a certain table. Is it possible to
> >> > retrieve the name of that table within the code of it's trigger?
> >> >
> >> > My goal is to write a code for universal trigger (it would do the same
> >> > thing on all tables). That trigger would call a procedure and pass the
> >> > name of it's parent table as a parameter.
> >> >
> >>
> >> Maybe this is a good starting point for further searches:
> >> http://forums.oracle.com/forums/message.jspa?messageID=512084
> >>
> >> What would your "universal" trigger do?
> >>
> >> cheers,
> >> Martin
> >
>
Copy&Paste is the single most evil thing I keep stubling over in sourcecode. It annoys me without end that (PL/)SQL makes it easy to solve things via c&p and makes it often amazingly hard to solve things The Right Way (which is never c&p as far as I'm concerned).
The code generation script is a rather decent way around this, since you don't maintain code n times, but instead maintain just one generation script. Still it would be nice if one wouldn't be forced to use it to begin with.
Anyway, I heartedly agree about TEST :-)
cheers,
Martin
Received on Thu Oct 05 2006 - 10:56:48 CDT
![]() |
![]() |