#1 2013-05-02 23:52:45

wienani
Member
Registered: 2012-08-31
Posts: 29

Request feature TSQLTable.InsertRecord

Hi AB,

NewRecord only append, can I request for Inserting ? like TSQLTable.InsertRecord(APos: integer; RecordType: TSQLRecordClass=nil)

I need this feature for inserting row in unbound devexpress grid.

Sorry my bad english.
TIA - Hanny

Offline

#2 2013-05-03 05:07:03

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,657
Website

Re: Request feature TSQLTable.InsertRecord

TSQLTable.NewRecord() does not append any data to the TSQLTable array.

As stated by its comment/documentation, it creates a new TSQLRecord instance for a specific Table.

In the RoadMap - http://synopse.info/fossil/wiki?name=RoadMap - a similar feature request is available:

Allow TSQLTable content to be modified - just like the BriefCase Model of TClientDataSet. It may then be saved locally (using a packed binary format), or updated remotely (using BatchUpdate) - this shall work from both TSQLRecord.FillPrepare (in reference to one list of TSQLRecord) and TSQLRecord.CreateAndFillPrepareMany (able to update a JOINed query from several TSQLRecord);
UPDATE: perhaps not worth it since we can now export SynDB or mORMot results as TClientDataSet: why reinvent the wheel when it is not a perfect match with our ORM and SOA design? - anyway, a potential implementation design could be : 1. convert TSQLTableJSON to a TObjectList of TSQLRecord instances; 2. map this list into a TDataSet custom type; 3. handle TSQLRecord instance properties modifications in the TDataSet (and filtering); 4. use ID primary key to allow remote update via a BatchUpdate) which may fulfill the "BriefCase Model" of TClientDataSet;

In your case, you should better use a TClientDataSet created from TSQLTable content.
See http://blog.synopse.info/post/2012/06/2 … t-or-SynDB

Offline

Board footer

Powered by FluxBB