Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009

    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:

    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:
    HOLDFLAG) VALUES(:1,:2,:3,:4,:5,:6,:7)
    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.

  2. #2
    Join Date
    Jan 2004
    Croatia, Europe
    Provided Answers: 4
    "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.

  3. #3
    Join Date
    Sep 2009
    Thanks for the quick response.

    While it may be the wrong approach, we're not allowed to use the form's existing functionality to perform any data operations.

    Anyway, I cleared it up, we have to use an On Insert trigger, and write our update statement within that. May be wrong, but it's what we've been told to do.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts