Home » Developer & Programmer » Forms » SQL NOT TO COMMIT (ORACLE FORMS 6i ,WINDOW 7 ULTIMATE(32))
SQL NOT TO COMMIT [message #620576] Mon, 04 August 2014 07:27 Go to next message
kilimanjaro
Messages: 151
Registered: May 2009
Location: Tanzania
Senior Member
hello friends

I'm stack in a little problem here. I want the form not to commit if the budgeted amount is smaller than the spent amount .Here is the query which doesn't give me the results I want. Thank you.


begin
if :FAMILY_BUDGET2.ITEM10 > :FAMILY_BUDGET.BUDGETED_AMMOUNT
then message ('YOU HAVE EXCEEDED THE BUDGETED AMOUNT.THIS TRANSACTION WILL NOT BE CAPTURED');
--NOT to commit
END IF;
EXIT_FORM;



END;
Re: SQL NOT TO COMMIT [message #620577 is a reply to message #620576] Mon, 04 August 2014 07:28 Go to previous messageGo to next message
Roachcoach
Messages: 1576
Registered: May 2010
Location: UK
Senior Member
Rollback?
Re: SQL NOT TO COMMIT [message #620579 is a reply to message #620577] Mon, 04 August 2014 07:33 Go to previous messageGo to next message
kilimanjaro
Messages: 151
Registered: May 2009
Location: Tanzania
Senior Member
I real don't know myself
Re: SQL NOT TO COMMIT [message #620582 is a reply to message #620579] Mon, 04 August 2014 07:47 Go to previous messageGo to next message
Littlefoot
Messages: 21808
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Which trigger is it?

I presume that RAISE FORM_TRIGGER_FAILURE is what you are looking for, such as
begin
  if :FAMILY_BUDGET2.ITEM10 > :FAMILY_BUDGET.BUDGETED_AMMOUNT then
     message ('YOU HAVE EXCEEDED THE BUDGETED AMOUNT.THIS TRANSACTION WILL NOT BE CAPTURED');
     raise form_trigger_failure;
  end if;
end;

Don't EXIT_FORM because users won't have enough time to read the message; the form would terminate and they would be puzzled.
Re: SQL NOT TO COMMIT [message #620612 is a reply to message #620582] Mon, 04 August 2014 10:07 Go to previous message
kilimanjaro
Messages: 151
Registered: May 2009
Location: Tanzania
Senior Member
Thank you very much little foot,It has worked.
I have used it on on-commit trigger.
Previous Topic: how to use if condition in the button
Next Topic: Open XML file with Excel from Forms
Goto Forum:
  


Current Time: Wed Apr 24 19:35:10 CDT 2024