You are not logged in.
Pages: 1
I just downloaded the latest version of the framework. In my old version, the TSQLRestServerDB had the following function, which I used in my app:
function UpdateField(Table: TSQLRecordClass; ID: integer;
const FieldName: shortstring; const FieldValue: RawUTF8): boolean; override;
In the most recent version that I downloaded, this function appears to have beenn changed to:
function UpdateField(Table: TSQLRecordClass; Where: integer;
const FieldName: shortstring; FieldValue: integer; ByID: boolean): boolean; override;
Is there another function that I can call in the new version that works the same as the old one or should I abandon this approach to updating record values?
Offline
This is the same function, just one additional parameter:
Take a look a the updated documentation:
/// update an individual record field INTEGER value from a specified ID or Value
// - if ByID=true, search for RowID=Where, otherwise search for FieldName=Where
// - return true on success
// - this method must be implemented in a thread-safe manner
function UpdateField(Table: TSQLRecordClass; Where: integer;
const FieldName: ShortString; FieldValue: integer; ByID: boolean): boolean; virtual; abstract;
So UpdateField(Table,WhereID,FieldName,FieldValue,true) is exactly the same as the previous version.
Just adding a ,true) at the end of the parameters list will work as expected.
Perhaps I should have made this explicit.
Online
The problem is that the FieldValue parameter is an integer value and not a RawUTF8
Offline
Online
Thanks for being so responsive! I have no idea how you are able to do this. I just hope that someone else of your caliber is able to get involved.
Offline
I've added this overloaded method in the source code repository.
See http://synopse.info/fossil/info/a7fad077bf
By the way, I think I've found out a potential issue in TSQLRestServerDB.UpdateField(ByID=true) implementation.
Should be fixed in the same time.
Online
Pages: 1