Re: Need Forms 5.0 help with inserting record

From: Ian C. Sellers <icslu_at_co.boulder.co.us>
Date: Fri, 29 Jan 1999 11:51:42 -0700
Message-ID: <36B2033E.74F001A2_at_co.boulder.co.us>


Ryan,

Since you have set the initial value of EMP_ID to a sequence, as soon as you start the form, it inserts a record and populates it with that initial value.

If you do not set an initial value for EMP_ID, but wait to select the sequence into EMP_ID during a block-level pre-insert trigger, you may avoid this 'default-insert' behavior. If I understand the problem correctly, this should solve it.

Hope this helps,
-Ian

Ryan wrote:

> I have created a form from single table (just to get familiar with
> forms) in forms 5.0 that does the following:
> Takes an employee ID (actually this is not enabled. Its initial value
> is set to a sequence and it works fine).
> Takes a first name, last name, job title, and phone number.
>
> My problem is that even though I have verified the dataypes and sizes
> between the form and the table I cannot get the form to insert the
> data. If I have the item property set to Primary Key = Yes on Employee
> ID (which it is) then It keeps telling me record has already been
> inserted. THis is not true however. If I set the proprty to say
> Primary key = No then I get the FRM-40508 error. I have tried
> inserting the data manually in SQLplus as the SAME USER and it works
> fine. ANY HELP would be appreciated.
>
> Ryan
>
Received on Fri Jan 29 1999 - 19:51:42 CET

Original text of this message