Re: Database Triggers and Forms 4.5

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/12/24
Message-ID: <882981345.1690763277_at_dejanews.com>#1/1


Whenever we have database triggers that update any columns that are also included in a form, we requery the data following the commit. If you don't want to re-query all blocks, but only the changed ones, you could use the following steps (This is what I do): Before the form does its commit_form, set a flag indicating the status of each affected block. Following the commit_form, check each flag, and for those that were 'CHANGED', go to the block and re-execute its query.

I use a small procedure to do the post-commit processing. I just pass it the before-commit flag and the block name for each block that needs to be handled.

You could also drop these columns from your blocks in the form, and they would be updated on the server, but wouldn't cause the problem you are having.

HTH
Steve Cosner



http://members.aol.com/stevec5088 -- downloadable QA utility form: Dynamic display and update access to any table.

In article <67olur$a9i_at_bgtnsc03.worldnet.att.net>,   "Joe Strano" <jstrano_at_dulcian.com> wrote:
>
> On every table, we have history columns to keep track of CREATE_BY,
> CREATE_DT, MODIFY_BY and MODIFY_DT.
> We have created a trigger on every table that has these columns to
> automatically populate them. The problem is when
> Forms writes info to the database, it sees the changes the triggers makes
> as a change done by another user. That record is now
> in-accessable until I re-query that block. I can't just re-query the block
> the cursor is in, since I might have changes info in 5 different
> blocks. I don't want to re-query every block because there are 35 blocks
> in this application. Our solution was to create a
> form level PRE-INSERT and PRE-UPDATE trigger to take care of this info for
> us. But, we are looking for a better solution. Any ideas?
>
> Joe Strano
> Dulcian, Inc.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Wed Dec 24 1997 - 00:00:00 CET

Original text of this message