Home » Developer & Programmer » Forms » frm-40508: oracle error: unable to Insert Record
frm-40508: oracle error: unable to Insert Record [message #203833] Thu, 16 November 2006 09:01 Go to next message
ghostly
Messages: 17
Registered: November 2006
Location: UK
Junior Member
Hi, i got a error message where i am unable to insert record. firstly the 2 table below:


CREATE TABLE Staff_Order
(Staff_Order_ID varchar2(6) NOT NULL,
Staff_ID varchar2(6) NOT NULL,
SO_date DATE,
Constraint staff_order_id_pk PRIMARY KEY (Staff_Order_ID ),
Constraint staff1_id_fk FOREIGN KEY (Staff_ID) REFERENCES STAFF);

which is okay but the table below is not able to save data when entered.

CREATE TABLE Staff_Order_delivery
(Staff_Order_ID varchar2(6) NOT NULL,
Product_ID varchar2(6) NOT NULL,
Pro_supp_id varchar2(6) NOT NULL,
Quantity_Required NUMBER,
Constraint staff_id_prod_id_cpk primary key ( Staff_Order_ID, product_id),
Constraint staff4_id_fk foreign key (Staff_Order_ID) REFERENCES Staff_Order (Staff_Order_ID),
Constraint pro_supp_fk foreign key (Pro_supp_id ) REFERENCES Product_Suppiers (Pro_supp_id),
Constraint product_id1_fk foreign key (product_id) REFERENCES product (product_id));

the staff order id does not save the data and that is all because i was unable to retrieve data from pro_supp_id which is a foreign key for the Actual_Unit_Price so the table for that is

CREATE TABLE Product_Suppiers
(Pro_supp_id varchar2(6) NOT NULL,
Product_ID varchar2(6) NOT NULL,
Supplier_ID varchar2(6) NOT NULL,
PS_Date_Purchased DATE,
PS_Quantity_Supplied NUMBER,
Actual_Unit_Price NUMBER,
Constraint pro_supp_id_pk PRIMARY KEY (Pro_supp_id),
Constraint prod_id_fk FOREIGN KEY (Product_ID ) REFERENCES Product,
Constraint Sup_id_fk FOREIGN KEY (Supplier_ID ) REFERENCES SUPPLIER);

Although i was able to save data but when i modified the Actual_unit_price post query with its text box than it went all wrong for some reason??

Has any1 got any ideas what could be the problem???

Re: frm-40508: oracle error: unable to Insert Record [message #203885 is a reply to message #203833] Thu, 16 November 2006 19:20 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Press Shift+F1 or help->display error at runtime so that you will know what really caused the problem.
Re: frm-40508: oracle error: unable to Insert Record [message #203891 is a reply to message #203885] Thu, 16 November 2006 19:37 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Post the Post_Query code please.

David
Re: frm-40508: oracle error: unable to Insert Record [message #204082 is a reply to message #203891] Fri, 17 November 2006 12:47 Go to previous messageGo to next message
ghostly
Messages: 17
Registered: November 2006
Location: UK
Junior Member
The Post query code is:

BEGIN
SELECT Actual_Unit_Price
INTO :Staff_Order_delivery.ACTUALPRICE
FROM Product_Suppiers
WHERE Pro_supp_id = :Staff_Order_delivery.Pro_supp_id
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;

Thanks
Re: frm-40508: oracle error: unable to Insert Record [message #204163 is a reply to message #203885] Sat, 18 November 2006 06:26 Go to previous messageGo to next message
ghostly
Messages: 17
Registered: November 2006
Location: UK
Junior Member
Hi when i click on the help??? it states this:

SQL STATEMENT ERROR:
SELECT ROWID,STAFF_ORDER_ID,PRODUCT_ID,PRO_SUPP_ID,QUANTITY_REQUIRED,ACTUALPRICE FROM STAFF_ORDER_DELIVERY WHERE (STAFF_ORDER_ID=:1)


eRROR:
ORA-00904: "ACTUALPRICE": invalid identifier
Re: frm-40508: oracle error: unable to Insert Record [message #204182 is a reply to message #204163] Sat, 18 November 2006 12:24 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It means that there's no ACTUALPRICE column in STAFF_ORDER_DELIVERY table.
Re: frm-40508: oracle error: unable to Insert Record [message #204265 is a reply to message #204182] Sun, 19 November 2006 22:35 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Go to the property sheet for "Staff_Order_delivery.ACTUALPRICE" and make sure that you have changed it to non-database.

David
Previous Topic: How to acquire value from a text box
Next Topic: tool tip
Goto Forum:
  


Current Time: Thu Apr 18 18:03:43 CDT 2024