Re: Sequences on Forms

From: Denny Dutcavich <dut_at_mindspring.com>
Date: Wed, 03 Nov 1999 14:57:05 -0500
Message-ID: <38209390.165C70DB_at_mindspring.com>


[Quoted] [Quoted] I am getting very frustrated here (but a lot smarter as well). I created a INSERT trigger against the table, using procedure builder. I tested it using plain old SQL INSERT commands in SQL*Plus and it worked very well. Now, when I try to use it in the form, I get a message from Forms saying the record is already inserted. I tried creating a ON-INSERT trigger against the block and I get the same message indicating the record was already inserted. I have put the edit control on the form, I left it off the form and I have hidden it - none worked. Is there some property for this object that I am over looking. This must be a simple process??? Thanks for any help...

Frans Hovenkamp wrote:

> wozi heeft geschreven in bericht ...
> >Two options:
> >
> >1. You can create an INSERT trigger which populate the primary key
> > column using the sequence.
> >2. Or you can wait until users complete processing and about to click a
> >button to commit_form, then you can call a function which uses the
> sequence
> >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;
> >
>
> Third Option: Put this function in a Pre-Insert Trigger
>
> Frans Hovenkamp
Received on Wed Nov 03 1999 - 20:57:05 CET

Original text of this message