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: Trigger Question

Re: Trigger Question

From: Alexander Poeppl <alp_at_inode.muc.de>
Date: 1998/01/03
Message-ID: <34AE2C0A.91ADF522@inode.muc.de>#1/1

The Hudsons schrieb:
>
 

> I'm looking for help. I have been asked to write my first trigger, and
 

> I don't know where to begin. I need a trigger that will populate a
> field with a unique value when an insert is done. I don't think that
> this should be too hard if I am inserting a single row, but when I
> insert multiple rows I would like the field to be the same for each row
 

> - is this possible? Could someone please point me in the right
> direction. Thanks in advance,
>
 

> Dunc

Hi Dunc,

just use a so called 'statement insert trigger'. This fires only once for an insert statement, e.g.

create or replace trigger <my trigger>
for insert on <my table>

begin

  <:NEW.COLUMN NAME> := <unique value>;
end;

I would propose to read in The Server Application Developer s Guide by Oracle to get a basic understanding of database triggers.

Bye, Alex Received on Sat Jan 03 1998 - 00:00:00 CST

Original text of this message

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