Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: FireDac.Update.Insert


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


Permlink Replies: 1 - Last Post: Sep 5, 2017 9:49 PM Last Post By: Dmitry Arefiev Threads: [ Previous | Next ]
marcos ramos

Posts: 1
Registered: 11/11/08
FireDac.Update.Insert  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 3, 2017 11:13 AM
Hi everyone, I have a question, is it possible to make an append using fdquery and in case the registry exists the same make an update? ex: fdquery.append; fdqueryID.asinteger = 1; fdqueryNAME.asstring = 'myname';
fdquery.applyupdates; if the registration with the code = 1 already exists the update in the registry
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: FireDac.Update.Insert  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 5, 2017 9:49 PM   in response to: marcos ramos in response to: marcos ramos
Default FireDAC data updating capabilities do not support that. But you can override them by using TFDUpdateSQL:
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Overriding_Posting_Updates_(FireDAC)#Using_TFDUpdateSQL

There you should define InsertSQL command, which will perform data merging. Depending on your DBMS, that may be MERGE or similar SQL command.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02