Re: Need Help With SQL*Forms and Nextval

From: Ed Maldonado <maldonad_at_motu370e.comm.mot.com>
Date: Thu, 8 Jul 1993 21:11:08 GMT
Message-ID: <1993Jul8.211108.29824_at_lmpsbbs.comm.mot.com>


In article <21hfg9$nsv_at_gaia.ucs.orst.edu> mickel_at_OES.ORST.EDU (Paul Mickel) writes:
>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.

	Could you use a PRE-INSERT trigger to get the sequence and 
	put it in the field.

>>>
>>> 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.
	You say "assign run numbers to a production process" would the 
	second block need this same number or a different (Next number in
	the sequence) Number.

>
>-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 - 23:11:08 CEST

Original text of this message