SQL Update() does not update
SQL Update() does not update
(OP)
Hi,
I have this code which does not update
Any clue how to find what is the cause of this unwanted behavior?
I keep on puzzling.
Koen
I have this code which does not update
CODE --> VFP
Update PERMISSION ; SET ; PERMISSION.Permissionnmbr = curPermiss5a.Permissionnmbr , ; PERMISSION.Permissionfrom = curPermiss5a.Permissionfrom , ; PERMISSION.Permissiontill = curPermiss5a.Permissiontill , ; PERMISSION.Permissiondate = curPermiss5a.Permissiondate ; FROM curPermiss5a ; WHERE PERMISSION.ID = curPermiss5a.ID lnRec = _Tally la = AERROR(aPermis) If lnRec = 0 lnError = 8 Else m.llSuccess = Tableupdate(.T.) Endif If llSuccess = .F. lnError = 16 Endif Select VERZEKNR
- The cursor curPermiss5a all fields have values.
The values of the both ID's are equal
aPermis does not show any update errors
My Errorcatcher is not activated
lnRec = 1
Any clue how to find what is the cause of this unwanted behavior?
I keep on puzzling.
Koen
RE: SQL Update() does not update
Bye, Olaf.
Olaf Doschke Software Engineering
https://www.doschke.name
RE: SQL Update() does not update
Buffering of cursor curPermiss5a was 5, I changed to 1: no effect.
Cursor was created with a SQL Select from 3 dbf's
CODE --> vfp
Regards,
Koen
RE: SQL Update() does not update
Did you try FLUSH FORCE command?
Regards,
Ilya
RE: SQL Update() does not update
Bye, Olaf.
Olaf Doschke Software Engineering
https://www.doschke.name
RE: SQL Update() does not update
An updatable cursor needs to be a view or CA, because you already get an error 1468, if you try to CURSORSETPROP("SendUpdates", .T.).
Bye, Olaf.
Olaf Doschke Software Engineering
https://www.doschke.name
RE: SQL Update() does not update
It is not the cursor curPermiss5a which needs to be updated it is the DBF Permission.DBF which needs to be updated.
This technique to update a dbf with the content from a cursor is used for 'ages'.
@Ilya,
The lowlevel 'Flush Force' was not issued, I will give it a try.
Regards,
Koen
RE: SQL Update() does not update
Bye, Olaf.
Olaf Doschke Software Engineering
https://www.doschke.name
RE: SQL Update() does not update
sorry I think I donot follow. What is fantastic?
Regards,
Koen
RE: SQL Update() does not update
CODE
Tamar
RE: SQL Update() does not update
I get a query with one record, correct according to the code, with all fields from PERMISSION.DBF and curPermiss5a with data from their relevant sources.
Koen
RE: SQL Update() does not update
Tamar
RE: SQL Update() does not update
I notice that the fields are not updated, they remain blank as initially.
You know I lost lust to find out what is going on here. So, since it is after all only an update of a few fields, I changed my code from
CODE --> VFP
CODE --> VFP
Thanks for your advise and sorry for bothering.
Koen
RE: SQL Update() does not update
Could this be SET SQLBUFFERING ?
hth
n
RE: SQL Update() does not update
You can check the Buffering with ln= Cursorgetprop('Buffering', cTableAlias)
if ln = 5 Optimistic Table Buffering is on
Regards,
Koen