Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers/sequences or interface code
I think there is room for debate on this one.
It does depend on the interpretation of
"manually doing it at the interface level"
and what happens after the key has been
generated.
For example if the interface does:
insert into xyz values(
seq_name.nextval ...
id_xyz into local_var
;
then that is more efficient than
adding a trigger to table, as the
trigger will have to go through the
process of doing a
select seq_name.nextval from dual;
-- Jonathan Lewis http://www.jlcomp.demon.co.uk Author of: Practical Oracle 8i: Building Efficient Databases Next Seminar - Australia - July/August http://www.jlcomp.demon.co.uk/seminar.html Host to The Co-Operative Oracle Users' FAQ http://www.jlcomp.demon.co.uk/faq/ind_faq.html Sybrand Bakker wrote in message ...Received on Sat Apr 27 2002 - 02:05:39 CDT
>
>"J. Harris" <John.Harris_at_nurs.utah.edu> wrote in message
>news:aac4nr$prm$1_at_coward.ks.cc.utah.edu...
>> For incrementing PK or unique ids what is the "recommended" method for
>> achieving the best result: using triggers on insert events or manually
>doing
>> it at the interface level (i.e., using vba with access, or using
>coldfusion,
>> etc).
>>
>> John Harris
>> University of Utah
>>
>>
>
>At the lowest level that is applicable, in this case triggers.
>Using VBA with Access or Coldfusion means running this code at the client
>side, and triggers run at the server side. Hence your second proposol will
>be much much slower.
>
>Regards
>
>
>--
>Sybrand Bakker
>Senior Oracle DBA
>
>to reply remove '-verwijderdit' from my e-mail address
>
>