Re: Getting NEXTVAL just prior to a COMMIT

From: Rick Banister <rick_at_sesame.com>
Date: 1995/09/18
Message-ID: <NEWTNews.811470668.12826.sesame_at_sesame.scruznet.com>#1/1


In Article<43chht$n41_at_ttis.thomtech.com>, <akapur_at_thomtech.com> write:
> Path: news.scruz.net!garlic.com!fox.almaden.ibm.com!uunet!in1.uu.net!tank.news.pipex.net!pipex!news.sprintlink.net!news.thomtech.com!admin
> From: Ashok Kapur <akapur_at_thomtech.com>
> Newsgroups: comp.databases.oracle
> Subject: Re: Getting NEXTVAL just prior to a COMMIT
> Date: 15 Sep 1995 18:44:13 GMT
> Organization: Thomson Technology Consulting Group
> Lines: 46
> Message-ID: <43chht$n41_at_ttis.thomtech.com>
> References: <42qn25$fm6_at_its.hooked.net> <42qtg9$sjp_at_ixnews5.ix.netcom.com>
> NNTP-Posting-Host: buggsy.thomtech.com
> Mime-Version: 1.0
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> X-Mailer: Mozilla 1.2b6 (Windows; I; 16bit)
>
> Better yet, try ON-INSERT trigger. This fires for each row that is
> inserted in the database. PRE-COMMIT trigger fires only ONCE per commit.
>
> Ashok Kapur
> akapur_at_thomtech.com
> jhas_at_ix.netcom.com (Swapan Jha ) wrote:
> >In <42qn25$fm6_at_its.hooked.net> Craig Harper <caharper_at_hooked.net>
> >writes:
> >>
> >>We are looking for suggestions on how to assign an ID number based on
 the
> >>NEXTVAL of a sequence generator, after all the other fields of the
 table
> >>have been filled in.
> >>
> >>The data will be entered through forms 4.5, I know that we can control
 

> >>the navigation, thus enabling us to enter the data for the other
 fields
> >>befor getting the nextval, but what trigger, or combo of triggers,
 would
> >>I use to perform this feat of magic. I can set it up so that I start
 with
> >>a when_button_pressed trigger, but then what?
> >>
> >>If anyone could point us in the right direction, Well thanks in
 advance,
> >>and many blessing to you and yours.
> >>
> >>Craig Harper
> >>
> >
> > Try Assigning the Seq.Nextval in the Pre-commit trigger (Block or
> >Form Level)
> >
> >
> > i.e.
> >
> > :block.item := Seq.NextVal;
> >
> >
> >Hope this helps
> >
> >Swapan Jha
>
>



Strongly suggest using a PRE-INSERT trigger for the affected block to get the nextval sequence. This saves having to modify the default insert action. Received on Mon Sep 18 1995 - 00:00:00 CEST

Original text of this message