Re: Works under SQL*Plus but not SQL*Forms procedure. ;-(

From: <stevec_at_zimmer.csufresno.edu>
Date: 1998/02/19
Message-ID: <6chu8i$huf$1_at_nnrp1.dejanews.com>#1/1


In article <6chf6b$38h_at_knot.queensu.ca>,   Steve Frampton <3srf_at_qlink.queensu.ca> wrote:
>
> I'm developing an SQL*Forms 3.0 application that allows the user to
> modify some information about employee groups. When the form is
> executed, any information that has been entered in the groups table
> is then applied to the employee table for all employees in the
> appropriate employee groups.
>
> The code that updates the table is called from a procedure, which is
> in turn called by a key trigger. This code works perfectly when run
> from SQL*Plus, but when run within the SQL*Forms procedure, nothing
> happens!! (I get, "No changes to commit" on the message line).

[Quoted] When you call a procedure that updates the database, the form is completely unaware of any changes being made. Forms is expecting your user to make changes to data on the form's screen.

To overcome your problem, what I do is issue the statement:

   FORMS_DDL('Commit');
This forces a server commit, but like your procedure call, forms is totally unaware of it.

There are two other methods you can use to get your procedure changes to commit:

    [Quoted]
  1. Set an item on the form to itself (:blk.item1 := :blk.item1; ). This forces the form to change the block status to CHANGED, so Commit_Form will commit everything. The drawback is that the row that you updated on the form will unnecessarily be updated on the server.
  2. Commit from within the procedure. This requires a database-level flag to be set: Commit_in_procedure or something like that. The drawback is that wherever this procedure is used, it will commit all updates, even those posted by other transactions in the same session.

Regards,
Steve Cosner



http://members.aol.com/stevec5088
Downloadable Quick Access utility form: Display and update any table.

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading Received on Thu Feb 19 1998 - 00:00:00 CET

Original text of this message