Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Posting inserts through queries based on a join


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Trevor Cooper

Posts: 45
Registered: 10/7/10
Posting inserts through queries based on a join  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 28, 2017 8:21 AM
Hi,

I've resolved the question I originally asked in this thread by studying

$(demos)\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDQuery\CachedUpdates\OnUpdateRecord

The extra aspects I had to consider when converting existing code to FireDAC for SQLite were:

- reviewing use of transactions, as when using TFDUpdateSQL to directly insert into multiple tables joined on foreign keys, the ID has to exist in the foreign table before the insertion can be made in the related table;
- setting 'UpdateOptions.RequestLive' to false, as otherwise the work of the TFDUpdateSQL is undermined;
- recognizing that UpdateOptions.UpdateNonBaseFields' and 'UpdateOptions.UpdateTableName' become irrelevant, and setting them has no effect

Trevor Cooper

Edited by: Trevor Cooper on Oct 16, 2017 4:26 AM

Edited by: Trevor Cooper on Oct 16, 2017 9:42 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02