Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NEWBIE: Autonumber trigger
Fred Ruffet schrieb in Nachricht
<7ieeeo$5ff$1_at_gatekeeper.ornano.kapt.com>...
>I don't think trigger is the better way for two major reasons :
>1. Oracle will refuse, when executing a trigger AFTER (or even BEFORE)
>INSERT, to make operations on your table (like for example counting the
>number of elements in the table).
>2. The number you want to set in the trigger is the primary key, and you
>couldn't process the insert statement whithout having this value.
>
You are definitifly WRONG. You can build a Trigger
'before_insert_on_each_row'
and you will be able to do ':new.PKField := seq.NextVal' ( Maybe it's wrong.
I'm not so firm in PL/SQLwithout docs).
For Mary: tere is a tool called something like 'Access Migration Wizard' lokated on your Oracle Client Software CD or (i thing) on Oracle's web site. It can convert your whole(?) Access App to work with Oracle as backend and it can create correct triggers for 'Autoincrement Fields'.
>A better way would maybe to do the insert within a PL/SQL procedure, which
>one you would be passing as args the values of the field to insert.
>
You are right. But Mary said: 'I'm VERY new to PL/SQL, ..' and she has to do
whole bunch of work in converting/adopting her app(s).
>
>David Rabsch a écrit dans le message <374ab0a1.4209402_at_news.mts.net>...
>>Hi, real newbie here. I'm trying to create an application using MS
>>Access 97 as a front end and Oracle 8 for Netware as the back end. I
>>created the app entirely in Access, and now am migrating the data to
>>Oracle. Does anyone have a simple trigger to emulate the AutoNumber
>>function in Access? I'm VERY new to PL/SQL, but pretty seasoned in
>>VB, and comfortable in SQL. Thx.
>
>
Juergen Lietz Received on Tue May 25 1999 - 13:25:29 CDT
![]() |
![]() |