Why not just create a set of variables to hold the initial values (SET
vCustX = .vCust,...) and then do a comparison after the form (IF vCust <>
.vCustX THEN;UPDATE...).  You could also do the updates for all the relevant
columns in the desired tables, even if the initial value & final value are
the same.  The first method could require a maximum of 39 updates (assuming
39 variables), the second would always take 10 updates (for 10 tables).  You
could also make variable comparisons for all variables associated with a
specific table (IF vCust <> .vCustX OR vAdd <> .vAddX OR...THEN;UPDATE...
{all fields associated with variables for this table}).

-----Original Message-----
From: tellef [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 9:09 AM
To: INTERNET:[EMAIL PROTECTED]
Subject: RE: Checking Variables for any change?


Rich:

>My problem is: What is the easiest way I can check which variables have
>been changed. I would then update only the appropriate table / tables
>(Approx. 10 tables) that are affected. <

Okay I doubt this is easier programming wise but maybe someone else could
think of a way to do this...  Would it be possible to load all the initial
variables into one column of a temp table, maybe even with 2 columns for
the
table & column that the variables refer to, then do a series of probably 39
update columns after the form to put the new values next to the old ones.
Then you can update where the old column <> new column, probably
dynamically
constructing the UPDATE statement as you go thru a cursor if you like.
It's technically cooler than doing 39 comparisons, but is it easier and
faster???

In case I was unclear, a temp table like this:

        OldValue   Table   Column   NewValue
        hello      Table1  Text1    hello
        bye        Table1  Text2    goodbye

Cursor thru the table where oldvalue <> newvalue, construct the
update statement using the table & column name in ampersand variables.
Worth trying?


Karen
              

Reply via email to