Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Question
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