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

Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers

Re: triggers

From: Olaf Musch <Olaf.Musch_at_computer.org>
Date: Wed, 14 Apr 2004 16:17:10 +0200
Message-ID: <c5jh3t$2ers8$1@ID-168133.news.uni-berlin.de>


"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

Original text of this message

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