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: J. Harris <harris.john.a_at_worldnet.att.net>
Date: Sun, 28 Apr 2002 01:39:45 GMT
Message-ID: <BpIy8.54380$QC1.3962966@bgtnsc04-news.ops.worldnet.att.net>


I really appreciate your good answers.

Is it fair to say, then, that we have a choice of application performance vs. code maintenance/reusability/portability? I guess most of us would go for application performance, but in light of this thread should code maintenance be considered? Any advice?

John Harris

"Vladimir M. Zakharychev" <bob_at_dpsp-yes.com> wrote in message news:aadrr8$ncm$1_at_babylon.agtel.net...
> As Mr. Lewis pointed out, getting sequence.nextval in trigger will require
> additional query from dual and will not give you the new value back, while
using
> INSERT (id,...) VALUES(sequence.nextval,...) RETURNING id INTO :host_var
> will do the the same job in one pass and will additionally give you back
> the new generated id where trigger will just silently generate it and
application
> will have to dig for it after insert (again, additional query). Result is
one statement
> instead of three (or two if generated id is not needed right away), and
easier
> maintenance.
>
> --
> Vladimir Zakharychev (bob_at_dpsp-yes.com)
http://www.dpsp-yes.com
> Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet
applications.
> All opinions are mine and do not necessarily go in line with those of my
employer.
>
>
> "Daniel Morgan" <dmorgan_at_exesolutions.com> wrote in message
> news:3CC9AF33.80AEE7E9_at_exesolutions.com...
> > "J. Harris" wrote:
> >
> > > 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
> >
> > SEQUENCE with BEFORE INSERT ROW LEVEL trigger.
> >
> > Daniel Morgan
> >
>
Received on Sat Apr 27 2002 - 20:39:45 CDT

Original text of this message

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