Re: Forms 4.5: Using 'commit;' in a trigger.

From: X <x_at_x.x>
Date: Tue, 14 Mar 2000 08:34:23 -0000
Message-ID: <8akt77$gdj$1_at_supernews.com>


>I would like to use a when-button-pressed trigger to insert a line into
>a table. When the trigger is getting to the line 'Commit;' the user is
>shown the message 'FRM-40401: No changes to save.' as there have been no
>changes to the current block.
>
>But if i take out 'Commit;' the line that is inserted does not get
>saved. How do i saved this insert without doing a commit_form;

There are two ways of inserting a record. One is the default forms functionality of navigating to a blank record and typing into it, the other is to code an insert statement in a trigger (which you have done). In both cases the records need to be committed. In your case, when you do 'commit' it is committing all the outstanding changes in the form - the problem is that because nothing has been changed in a base table block, forms thinks that there is nothing to change; so although it has committed your record it gives the error message. In fact this only has a severity level of 5 so it's actually just an information message. If you set :system.message_level to 5 before doing the commit and reset it afterwards, everything will work fine.

--
--
====================================
Pete Kolton
Oracle Systems Consultant
All reasonable offers considered :-)

Email: Pete_at_Kolton.com
Web:   http://www.kolton.com

====================================
Received on Tue Mar 14 2000 - 09:34:23 CET

Original text of this message