Re: Sequences on Forms
Date: Mon, 1 Nov 1999 17:47:51 -0800
Message-ID: <F4BA8457A1B8F4E3.63E887936A7A3C0B.A910D60998396E53_at_lp.airnews.net>
Two options:
-
[Quoted]
- You can create an INSERT trigger which populate the primary key column using the sequence.
- Or you can wait until users complete processing and about to click a [Quoted] button to commit_form, then you can call a function which uses the sequence [Quoted] to assign a value to the text item. Example below: :my_block.text_item := get_sequence_id;
FUNCTION Get_Sequence_id RETURN number IS
seq_id number;
BEGIN
select seq_name.nextval into sed_id from dual;
return seq_id;
END;
hope that helps
Denny Dutcavich wrote in message <381E12EF.B0ECE3A8_at_mindspring.com>...
>I attached a sequence to an initial value for a primary key. And it
>increments ok. My question is, is there a better way to implement this?.
>If I go back to update a record, with a few bad clicks, the sequence
>keeps incrementing. In the larger scheme of things, I don't think I'll
>run out of numbers. What I want to do is use NEXTVAL only when I need it
>- like when I am actually inserting the record not just every time focus
>is on the edit control. Thanks for any thoughts...
>
Received on Tue Nov 02 1999 - 02:47:51 CET