Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers
"Choung" <cchao_at_pmc.ca> schrieb im Newsbeitrag news:Jybfc.27050$kc2.387848_at_nnrp1.uunet.ca...
> Hi,
>
Hi Choung,
> I have this trigger:
>
> CREATE OR REPLACE TRIGGER "SYS"."LICENSE_USAGE"
> BEFORE DELETE OR UPDATE
> ON "ADMUSER"."USESSION"
> FOR EACH ROW BEGIN
>
[Trigger code snipped]
>
> This triggers works but I'm trying to get the trigger to write to my table
> when there has been an entry made. I don't want any duplicates either. Any
> suggestions?
>
Before or after insert?
If before, just say
CREATE OR REPLACE TRIGGER "SYS"."LICENSE_USAGE"
BEFORE INSERT OR DELETE OR UPDATE
ON "ADMUSER"."USESSION"
FOR EACH ROW BEGIN
If after you have to create another trigger
(with possibly the same code) and the header
CREATE OR REPLACE TRIGGER "SYS"."LICENSE_USAGE_AIR"
AFTER INSERT
ON "ADMUSER"."USESSION"
FOR EACH ROW BEGIN
That's why it's a good idea to name triggers
with something like _AIR (After Insert for each Row)
or _BIDUR (Before Insert or Delete or Update for each Row)
Have fun
Olaf Received on Wed Apr 14 2004 - 09:17:10 CDT