Re: Dev2000 Insert and Commit without visible block

From: Marc Nicholls <marc.nicholls_at_mcmail.com>
Date: 1998/01/30
Message-ID: <34d2417b.0_at_news.mcmail.com>#1/1


A stand-alone insert, update or delete DML statement in forms does not affect the status system variables (ie :SYSTEM.record_status, :SYSTEM.block_status and :SYSTEM.form_status) unlike a change to an item in a base-table block. Hence the value in these variables remain the same after such a DML statement as it was before, and in your example it would appear that it remains 'NEW'. Hence Forms doesn't know that you've made a change, and therefore gives you the message 'No changes to save'.

The answer is to change the message level (:SYSTEM.message_level) before the COMMIT, and to reset it afterwards. Ideally you should reset the message level to whatever it was before the COMMIT, hence not affecting any other code.

For now try

    :SYSTEM.message_level := 5;
 COMMIT;
    :SYSTEM.message_level := 0;

Hope this helps
Marc

Joseph Scherer wrote in message <6asrc6$763_at_camel20.mindspring.com>...
>I have what may be a weird question. I would like to insert
>a new record into a table every time an application starts.
>I am using the 'WHEN-NEW-FORM-INSTANCE' trigger and
>attempting to perform an SQL INSERT statement. I think all
>of that works fine. However, I have attempted to perform
>an immediate COMMIT. My changes are saved to the database,
>but I get an error message stating there are 'No changes to
>save.'
>
>I have tried to trap this error in the trigger's PL/SQL code
>using the EXCEPTION section, but I cannot. Apparently, the
>error is occurring somewhere else in the commit processing.
>I know that I can customize the COMMIT trigger firing, but I
>do not want to affect the application as it is pretty
>complex.
>
>All I want to do is insert a record into the table and
>perform an immediate commit. I do not want any user
>intervention or GUIs for the values. However, like I said
>before, I do not want to affect any critical changes to the
>existing application either. Can anyone help?
>
>Thanks,
>Joseph
>
>
>
Received on Fri Jan 30 1998 - 00:00:00 CET

Original text of this message