>Hi Y'all,
>
>I have a local view that when it is updated, it does the odd "wierd" thing to the table - much as if I had hand-written an "update" statement that had some logic error in it.
>
>Is there any way I can grab the actual SQL statement that VFP is using to do the table update? This is a local view using VFP as the data engine so it's not like I am using ODBC or SQL server where I can capture what is being sent to the back end. I looked around for a SYS() command that might give this to me but I could not find anything.
>
>Albert Gostick
You don't say what "weird" stuff is happening, but here's a start.
The WhereType tells you what would be added:
1 - Key fields only: e.g., if keyfield = "iid" and current row iid = 3 then tags this to the update:
"WHERE iid = 3"
2 - Key and Updatable fields - in addition to the key field, adds to the where down the list of updatable fields, e.g.:
"WHERE iid = 3 AND field1= old_field1_value AND field2 = ...."
3 - Key and Modified fields - same as 2, but for modified fields instead of updatable, e.g. if only field2 was modified:
"WHERE iid = 3 AND field2 = old_field2_value"
4 - Key and Timestamp - more applicable to SQL Server remote views - same as 1, but compares timestamps as well, e.g.,
"WHERE iid = 3 AND timestamp=old_timestamp_value"
My guess is you have a couple of different records that match the WHERE that is added.
Insanity: Doing the same thing over and over and expecting different results.