Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Triggers/sequences or interface code

Re: Triggers/sequences or interface code

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 27 Apr 2002 08:05:39 +0100
Message-ID: <1019891455.25305.0.nnrp-13.9e984b29@news.demon.co.uk>

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
            ...

    )
    returning

        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 ...

>
>"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
>
>
Received on Sat Apr 27 2002 - 02:05:39 CDT

Original text of this message

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