Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Trigger: Simulating AutoCounter of MSAccess (Newbie)
Stefan/Ich,
If you want to duplicate more of the attributes of an autonumber you should
qualify the
for each row :
for each row when (new.betreuernr = 0 or new.betreuernr is null)
That way whenever you supply your own value (typically when loading data) it will be used rather than the sequence. So you can create your sequence and trigger at the same time as the rest of the database, rather than waiting till after initial data upload.
Regards
"Stefan Donath" <harald.gogger_at_de.bosch.com> wrote in message
news:a4vr37$9e1$1_at_ns1.fe.internet.bosch.com...
>
> Well, I got it!
>
> The following trigger does it will:
>
> CREATE or replace TRIGGER PMST27.T_Betreuer_AW_Trig before insert on
> PMST27.T_Betreuer for each row
> begin
> Select T_Betreuer_seq.nextval into :new.betreuernr From DUAL;
> end;
>
>
>
Received on Wed Feb 20 2002 - 07:37:36 CST
![]() |
![]() |