Re: FRM-40509 Error when trying to insert a new record...

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Sat, 31 May 2003 10:25:00 -0700
Message-ID: <3ED8E56C.F6D39E00_at_exxesolutions.com>


Joshua Wellman wrote:

> I'm using Form Builder 6.0.8.14.1.
>
> I have a vendor table with 10 fields. When inserting records via
> SQL*Plus I have no problems... However, using form builder I get a
> FRM-40509 error.
> Here is my table:
> SQL> desc vendor;
> Name Null? Type
> ----------------------------------------- -------- ------------
> VENDOR_ID NOT NULL NUMBER(8)
> VENDOR_NAME NOT NULL VARCHAR2(20)
> CONTACT_NAME NOT NULL VARCHAR2(20)
> PHONE NOT NULL VARCHAR2(15)
> FAX VARCHAR2(15)
> ADDRESS NOT NULL VARCHAR2(30)
> CITY NOT NULL VARCHAR2(15)
> STATE NOT NULL CHAR(2)
> ZIP NOT NULL CHAR(5)
> EMAIL VARCHAR2(30)
>
> My data block is named VENDOR_BLOCK and my fields on the form are
> names like the fields above with the exception of "_text" at the end.
>
> Here is my trigger for creating a new vendor:
>
> --CLEARS FORM
> CLEAR_VENDOR_FORM;
> --GENERATES NEW VENDOR ID
> SELECT vendor_id_seq.NEXTVAL
> INTO :VENDOR_BLOCK.VENDOR_ID_TEXT
> FROM DUAL;
> GO_ITEM('VENDOR_BLOCK.VENDOR_NAME_TEXT');
> --toggles buttons on and off as needed
> --create new button
> SET_ITEM_PROPERTY('CREATE_BUTTON' , ENABLED, PROPERTY_FALSE);
> --save new button
> SET_ITEM_PROPERTY('SAVE_BUTTON' , ENABLED, PROPERTY_TRUE);
> --update existing button
> SET_ITEM_PROPERTY('UPDATE_BUTTON' , ENABLED, PROPERTY_FALSE);
>
> Here is my trigger for saving new/inserting record:
>
> --update the vendor table
> INSERT INTO vendor VALUES
> (
> :VENDOR_BLOCK.VENDOR_ID_TEXT,
> :VENDOR_BLOCK.VENDOR_NAME_TEXT,
> :VENDOR_BLOCK.CONTACT_NAME_TEXT,
> :VENDOR_BLOCK.PHONE_TEXT,
> :VENDOR_BLOCK.FAX_TEXT,
> :VENDOR_BLOCK.ADDRESS_TEXT,
> :VENDOR_BLOCK.CITY_TEXT,
> :VENDOR_BLOCK.STATE_TEXT,
> :VENDOR_BLOCK.ZIP_TEXT,
> :VENDOR_BLOCK.EMAIL_TEXT
> );
> COMMIT;
> SET_ITEM_PROPERTY('SAVE_BUTTON' , ENABLED, PROPERTY_FALSE);
> SET_ITEM_PROPERTY('CREATE_BUTTON' , ENABLED, PROPERTY_TRUE);
> SET_ITEM_PROPERTY('UPDATE_BUTTON' , ENABLED, PROPERTY_TRUE);
>
> I also have an LOV for selecting current Vendor ID'S. I have read a
> couple of entries on this board and a couple of people have suggested
> making sure that all fields "database item" property is set to yes. I
> have checked all of them and they are correct. Also, I have read not
> so leave my vendor id field's(field that has an LOV button for it)
> "validate from list" property to no. It is also set correct. I'm not
> sure what else to check... I have found that when I load the form up,
> I have to click the "Enter Query" and "Execute Query" button on the
> toolbar before I can do anything at all. If I don't, my LOV button
> doesn't work, and my insert and save buttons don't work. After
> clicking the buttons on the toolbar, my first record appears on the
> screen and my LOV button works just fine. When I click my "insert
> new" button, the form is cleared and a new vendor id is placed in the
> vendor_id_text field. I fill in all the rest of the fields and click
> save and POOF an error!! FRM-40509!! I'm seriously thinking of
> scrapping my forms and starting over in Visual Basic... Any help
> would be great.. I'm about to throw this monitor off the desk...
> Thanks much....

Without the actual error message no help is possible but why do you have an insert statement in a trigger and in which trigger did you put it?

All you need is a save button with a single line of code: COMMIT_FORM; I think a far better course of action than going to VB would be to learn the tool you are using.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sat May 31 2003 - 19:25:00 CEST

Original text of this message