Unanswered: Forms save button tries to insert, not update
I'm new to Oracle forms, and am taking it at university. I understand the general reluctance to help people with homework, but I ask that you please just try and point me in the right direction.
Oracle Forms Builder version: 10.1.2.0.2
I've developed a form that's supposed to let the user select an ID from a LOV (or by entering it manually into a text item, and following this, should retrieve certain data from two tables, and display it in several other text and display items, and this works just fine.
It then needs to allow the user to modify one of the text items, and then perform validations on it. This is also fine.
Following that, the user is to click the save button, which should update the database. At this point I have a problem.
When I click save, after modifying the one item that I should be, the form tries to insert, which fails.
The statement in error is:
SQL> INSERT INTO SBACCOUNT
And the error is:
ORA-01400: Cannot insert NULL into ("userid"."SBACCOUNT"."CUST_NO")
Can anyone please explain why my form is trying to insert instead of update?
Your help would be appreciated, thank you.
"Retrieving" a record should be done by using Forms built-in querying technology.
1. enter <Enter query> mode
2. fill items used as a search criteria (some of them can be filled via LoV, no problem)
3. <Execute query>
If you insist on doing that via LoV only (as I've seen on another forum, so - perhaps you two are colleagues (or even the same person, doesn't matter really), I believe that this is a WRONG APPROACH. Because, if you are in INSERT MODE (and you are, unless you press <Enter query> (or run it via trigger or ...), your "overtyping" will NOT update an existing record, but insert a new one.