This discussion is archived
4 Replies Latest reply: Mar 19, 2013 3:39 AM by XeM RSS

Commit says no-changes to save after SQL update in forms

XeM Newbie
Currently Being Moderated
Hi all,

I using oracle forms 10g R2. In one of my form i have a control block on which there is some text items when user enter data in these items and then press a button next to these items which updates a database table by sql update query

on the next line after update query i have called commit; procedure and then in the last

if form_success then
message ('record updated');
else
message ('updated failed');
end if;

the problem i am facing is first message appears FRM-4040 No changes to save and then my message record updated, now my question is how i can avoid no-changes message because it creates confusion. Your reply is much appreciated
  • 1. Re: Commit says no-changes to save after SQL update in forms
    HamidHelal Guru
    Currently Being Moderated
    974222 wrote:
    Hi all,

    I using oracle forms 10g R2. In one of my form i have a control block on which there is some text items when user enter data in these items and then press a button next to these items which updates a database table by sql update query

    on the next line after update query i have called commit; procedure and then in the last

    if form_success then
    message ('record updated');
    else
    message ('updated failed');
    end if;

    the problem i am facing is first message appears FRM-4040 No changes to save and then my message record updated, now my question is how i can avoid no-changes message because it creates confusion. Your reply is much appreciated
    Take a form level trigger named PRE-FORM and write down the following code
    /* sample PRE-FORM trigger code */
    :SYSTEM.MESSAGE_LEVEL := 5;
    Hope this works..

    Mark correct/helpful to help others to get right answer(s).*
  • 2. Re: Commit says no-changes to save after SQL update in forms
    XeM Newbie
    Currently Being Moderated
    Thank you
    for your prompt reply and it solve my issue but it suppress the default message for commit, like
    Transaction complete: (xyz) Record applied and saved Now on the other blocks this message doesn't appear after commit
  • 3. Re: Commit says no-changes to save after SQL update in forms
    HamidHelal Guru
    Currently Being Moderated
    974222 wrote:
    Hi all,

    I using oracle forms 10g R2. In one of my form i have a control block on which there is some text items when user enter data in these items and then press a button next to these items which updates a database table by sql update query

    on the next line after update query i have called commit; procedure and then in the last

    if form_success then
    message ('record updated');
    else
    message ('updated failed');
    end if;

    the problem i am facing is first message appears FRM-4040 No changes to save and then my message record updated, now my question is how i can avoid no-changes message because it creates confusion. Your reply is much appreciated
    Then remove the PRE-FORM trigger.

    add bellow code before your COMMIT; code. smple
    .....
    :SYSTEM.MESSAGE_LEVEL := 5;
    
    commit;
    
    
    if form_success then
    message ('record updated');
    else
    message ('updated failed');
    end if;
    :SYSTEM.MESSAGE_LEVEL := 0;
    Hope this works..

    Mark correct/helpful to help others to get right answer(s).

    Edited by: HamidHelal on Mar 19, 2013 3:44 PM
  • 4. Re: Commit says no-changes to save after SQL update in forms
    XeM Newbie
    Currently Being Moderated
    Thank you very much this worked perfectly.

    Edited by: 974222 on Mar 19, 2013 3:38 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points