On Thu, Oct 3, 2019 at 10:45 AM juergen@wondzinski.de wrote:
Sorry but SQL INSERT always does position on the new record. This is documented even in the helpfile:
OK, w00dy, thanks for the correction. My VFP knowledge is legacy these days ¯_(ツ)_/¯.
Ask me about MariaDB 10 or PHP 7 on Linux :)
I think the key point is that if you "ASSuME" the record pointer in a table is in the correct place, you can get burnt. I've seen grids/browse refresh change the current record, or a UDF fired off a timer, or even a menu option (I'm thinking a WHEN?) that wiggles pointers, or multiple forms/application instances interfere. I'm a big fan of the "belt and suspenders" method of updating tables, so
REPLACE ThatTable.ThatColumn WITH "ThisValue" FOR ThatTable.PrimaryKey = TheRIghtValue AND ThatTable.ThatColumn = "OldValue"
or:
UPDATE ThatTable SET ThatColumn="ThisValue" WHERE ThatTable.PrimaryKey = TheRightValue AND ThatTable.ThatColum = "OldValue"