if you execute an update
is there any way to know how many rows has been updated?
thanks
is there any way to know how many rows has been updated?
thanks
Last edited:
dim SQL1 as SQL 'in process global
Dim txt as string 'globals
Dim UpdatedRecos as Int 'globals
txt="UPDATE MyTable SET City= 'Rome' WHERE Country='Italy'"
SQL1.ExecNonQuery(txt)
txt="SELECT count(*) FROM myTable WHERE City= 'Rome' AND Country= 'Italy'"
UpdatedRecs=SQL1.ExecQuerySingleResult(txt)
msgbox(UpdatedRecs,"Number of updated records.")
Dim SQL1 as SQL 'in process global
Dim txt as string 'globals
Dim UpdatedRecos as Int 'globals
txt="UPDATE MyTable SET City= 'Rome', MyUpdate =1 WHERE Country='Italy'"
SQL1.ExecNonQuery(txt)
txt="SELECT count(*) FROM myTable WHERE MyUpdate = 1"
UpdatedRecs=SQL1.ExecQuerySingleResult(txt)
Msgbox(UpdatedRecs,"Number of updated records.")
txt="UPDATE MyTable SET MyUpdate =0 WHERE MyUpdate = 1"
SQL1.ExecNonQuery(txt)
the idea is good
but in a multi user environment if you want to be sure
you have updated the record you must at least add a couple
of fields last_user and last_datetime
something like a timestamp
i did it for same applications
but it is a little bit too complex
thanks anyway
Not really complicated.I was wondering when you are going to get on this.
Nice one. I wasn't familiar with this keyword.I looked at the SQLite documentation, found the changes() function