Re: ?? about sequences and 'Order By' clause on forms

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 11 Nov 2000 15:06:35 +0100
Message-ID: <973951574.22512.5.pluto.d4ee154e_at_news.demon.nl>


It is customary to do this on pre-insert. However, if the user doesn't commit, one sequence number is wasted. You could consider moving this to the before insert trigger on table level, which is fired *after* the user issues commit. However, doing so, you will be forced to requery the record, because otherwise the sequence number will not be displayed.
Also note to make sure you don't waste sequence numbers you need to use nocache noorder on sequence definition, or alter your sequence afterwards.

Hth,

Sybrand Bakker, Oracle DBA

"Richard Hollingsworth" <william.hollingsworth_at_hsv.boeing.com> wrote in message news:3A0ACDEA.7A3C20E1_at_hsv.boeing.com...
> Hi. Thanks for reading this.
>
> I have a ?? about using sequences. I have a seq declared, and I want to
> use it to auto. update the CR_NUMBER field on a "6i" form. Currently
> the 'Select' statement is on a Pre Insert trigger on the data block.
> Somehow, the sequence is getting bumped when it is not supposed to. I
> want the seq. to get bumped ONLY when the user commits the record. Most
> of the time it works ok on the Pre Insert trigger, but now and then it
> bumps the sequence by several numbers instead of only 1.
>
> Any ideas? Is there a better trigger to use for this?
>
> Next question is about the 'Order by' clause on the data block
> properties. I do an 'Ececute Query' on form startup in order to get the
> records from the table into the form so you can look at them. I want
> them to come in sorted by CR_NUMBER.
> I put "order by cr_number" on the Orber By clause property for the
> block, but this does not work.
>
> How do you order records when you bring up a form?
>
> Thanks for any advise,
> Richard Hollingsworth
>
Received on Sat Nov 11 2000 - 15:06:35 CET

Original text of this message