You are not logged in.
Hi Ab,
Is there a way to get all field names in CSV format for a TSQLRecord?
I need such a function because I want to avoid updating some of the fields via the '' parameter when calling Update().
It'll be idea to be able to:
const
cFieldNotToUpdate = 'field1';
var
fieldsToUpdate: string;
myRec: TSQLPerson;
begin
fieldsToUpdate := myRec.GetAllFieldNamesInCSVFormat;
//so that I can:
fieldsToUpdate := ReplaceStr(fieldsToUpdate, cFieldNotToUpdate , '');
aDb.Update(myRec, fieldsToUpdate);
...
I hope'll you get my point.
Or even better, in future versions to provide a new parameter for the Update() method called 'fieldsNotToUpdate' which does the opposite of the 'customFields' param
Last edited by edwinsn (2015-09-18 14:20:15)
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Use TSQLRecord.RecordProps.
The TSQLRecordProperties class gives access to the high-level ORM information from RTTI.
Then use e.g. the CSVFromFieldBits() method, and the other methods/properties.
Offline
Great! Thanks AB!
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline