Re: Need Help With SQL*Forms and Nextval

From: Paul Mickel <mickel_at_OES.ORST.EDU>
Date: 8 Jul 93 15:46:17 GMT
Message-ID: <21hfg9$nsv_at_gaia.ucs.orst.edu>


In article <7585.2c3add64_at_hayes.com> fgreene_at_hayes.com writes:
>In article <david.r.barstis-060793082740_at_no-name-medadmin.med.umich.edu>, david.r.barstis_at_med.umich.edu (David R. Barstis) writes:
>> Hello, I have a field in a master-block that is the primary key. I want
>> to make this unique by using a sequence. If I set the default value to
>> :sequence.seqname.nextval it works fine, except that every time I go to
>> that block it generates a new sequence number, thus "wasting" sequence
>> numbers. Is there a way that I can avoid this "wasting". I would like
>> the number to be displayed to the user and to be propagated down to the
>> many (five) detail-blocks correctly.
>>
>> Any Suggestions?
>>
>>
>> Dave Barstis
>> E-mail: david.r.barstis_at_med.umich.edu
>>
>> "I'm so broke I can't even pay attention!"
>
>
>Attach an ON-NEW-FIELD-INSTANCE trigger to the field and test for a NULL
>condition. If it is not null then skip to the next field.

We had attempted to use sequence numbers in one of our forms to assign run numbers to a production process. The form we were using was a 2-block form. What we found was that the the next run number generate was three more than the last, with the pattern in increment being (#block_on_form+1). We couldn't find a work around and had to abandon the use of sequences.

-Paul

-- 
Paul M. Mickel			  	   Internet:mickel_at_oes.orst.edu
Database Programmer, Teledyne Wah Chang    Albany, OR   97321
Disclaimer: My employer never claims my opinions (unless it makes a profit).
Received on Thu Jul 08 1993 - 17:46:17 CEST

Original text of this message