Home » Developer & Programmer » Forms » FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) (ORA Forms Builder v. 11.1.2.0, Windows XP, (Oracle VM Virtualbox 4.1.22))
FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #568820] Tue, 16 October 2012 21:35 Go to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
I have this error. To put it simply I have two blocks.
Block1 contains two drop down list with PL/SQL statements for queries.
Block2 contains tabular form created from block wizard (I tried already in manual)
that will catch the result in Block1 queries.

Now I have a button with a trigger when-button-pressed that contains

BEGIN
INSERT INTO dummy1
VALUES ('hello',1,2,3);
COMMIT;
END;

My goal is to add into dummy1 values from :block2.item_name1, :block2.item_name2, :block2.item_name3
but to put it simply I tried these values but I received the same error.
When I run it and first things first click the button, the values will be added into dummy1 table
but when I execute the block1 - dropdown list queries and try to press the button. I received the error.
Please help me. I urgently need this. Thanks.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #568874 is a reply to message #568820] Wed, 17 October 2012 06:14 Go to previous messageGo to next message
cookiemonster
Messages: 10930
Registered: September 2008
Location: Rainy Manchester
Senior Member
The error is not due to that insert statement.
The commit causes oracles default insert process to run. This will try to insert records from the datablocks into the DB.
That's erroring.
Use the display error option on the run time help menu to see why it's erroring.
I doubt you need the insert statement at all.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #569613 is a reply to message #568874] Tue, 30 October 2012 05:31 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
Thanks for the reply cookiemonster. But I need the insert statement. This was solved by going to property palette and changing the properties of the two blocks in 'database data block' to 'No' and all goes well with me!
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #569622 is a reply to message #569613] Tue, 30 October 2012 07:14 Go to previous messageGo to next message
cookiemonster
Messages: 10930
Registered: September 2008
Location: Rainy Manchester
Senior Member
It's rare to need manual inserts in forms, but without more info what you doing I can't comment on your case.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #569684 is a reply to message #569622] Wed, 31 October 2012 05:12 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
I don't get this statement. 'It's rare to need manual inserts in forms.'
I am new in oracle forms builder and PL/SQL even reports (all oracle programs) and I am learning it for now.
But in my recent project, we have to make an "Online Ordering System" using Oracle Forms.

This is the business flow:

1. User inputs required information
-email
-name
-password
-contact info
-credit card details (required if preferred)
2. User selects preferred method of payment
3. user selects preferred brand and item category
4. user selects items from preferred brand and category
5. user completes request by submitting
6. central repository receives order
7. system automatically assigns nearest branch for order
8. branch handles order and reports on status via central repository
9. once delivery is complete, transaction for the order is complete

And obviously, one or two or almost every button must use insert statement to our table in order to get the value using the bind reference ( : ) in every blocks.

Or maybe there is a better way. I don't know but in your statement, maybe it has.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #569701 is a reply to message #569684] Wed, 31 October 2012 07:22 Go to previous messageGo to next message
cookiemonster
Messages: 10930
Registered: September 2008
Location: Rainy Manchester
Senior Member
reppihsrow wrote on Wed, 31 October 2012 10:12
I don't get this statement. 'It's rare to need manual inserts in forms.'

Manual insert = hard coded insert statement.
Oracle forms default processing constructs the necessary inserts to insert data from a datablock to the DB.
I've written loads of forms and hardly ever coded an insert statement (or update or delete).

reppihsrow wrote on Wed, 31 October 2012 10:12

And obviously, one or two or almost every button must use insert statement to our table in order to get the value using the bind reference ( : ) in every blocks.

It might be obvious to you but it isn't to me, and your business flow is a bit to high level to make it clear.
How many datablocks do you have?
What data goes in what block?
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #570252 is a reply to message #569701] Wed, 07 November 2012 04:39 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
My values ('hello',1,2,3) are for debugging purposes.
Its actual values are (:field_name1, :field_name2 . . . etc)

My part in that project is the main ordering transaction.
I did it by using two blocks.
Every food or beverages that a user will choose must insert into a
global temporary table that's why I must use an insert statement.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #570278 is a reply to message #570252] Wed, 07 November 2012 08:10 Go to previous messageGo to next message
cookiemonster
Messages: 10930
Registered: September 2008
Location: Rainy Manchester
Senior Member
And again - why must you insert into a global temp table?
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #570389 is a reply to message #570278] Thu, 08 November 2012 09:42 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
This is the screenshot of the project.

The main ordering system.
And this is the two blocks.


And for your question why global temporary table.
e.g. There are two person who are simultaneously using my ordering forms.

Person 1 is John
Person 2 is Peter

John chooses
brand name > Yellow Cab
category name > Pizza and Pasta
typical order in a restaurant.

Peter chooses
brand name > Mcdonald
category name > Drinks and Chicken Meals
another typical order.

My code in total_order_display item is that every time a person will press add, his preferred order will be inserted in the table and will query it again to my temporary order table and fetch to display. When the button submit pressed, that's the time that it will be inserted in our table which is order list.
Why Global Temp? Because if it is not.
Peter will see the order of John and vice versa because at the same time they are using my database . . .
An online ordering system without using update, insert or delete statement? I don't how to do that.

You may take a look also in our Logical Data Diagram if still you are confused.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #570390 is a reply to message #570389] Thu, 08 November 2012 09:44 Go to previous messageGo to next message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
Ordering System > http://img708.imageshack.us/img708/3372/ordering.png
Blocks > http://img594.imageshack.us/img594/306/blocksji.png
Logical Data Diagram > http://img31.imageshack.us/img31/4056/lddz.jpg

I am not allowed to post links until here. That's why I separate it.
Re: FRM-40508: Oracle error: unable to INSERT record (Simple/Weird error) [message #575890 is a reply to message #570390] Mon, 28 January 2013 21:44 Go to previous message
reppihsrow
Messages: 22
Registered: October 2012
Junior Member
Thanks for your time in this cookiemonster.
I am now understands your point of view.
We are disregarding the built-in oracle forms toolbar in this project. That's why!
Anyway, thanks again.
Previous Topic: Forms calling a Rich Text Format file.
Next Topic: ora-12703 this character set conversion is not supported
Goto Forum:
  


Current Time: Tue Sep 02 10:44:43 CDT 2014

Total time taken to generate the page: 0.13003 seconds