Stano 143 Posted February 14, 2022 My experiment (s) FMTSpace.UpdateOptions.UpdateTableName := 'DISTANCES'; FMTSpace.UpdateOptions.EnableInsert := True; FMTSpace.UpdateOptions.UpdateChangedFields := True; FMTSpace.Active := True; FMTSpace.CachedUpdates := True; /// Filling FMTSpace with data FMTSpace.ApplyUpdates(-1); That's how it works for me. I consider it extra work. for var J := 0 to FRecordCount -1 do begin for K := 0 to qryDistanceIns.Params.Count -1 do qryDistanceIns.Params[K].Values[J] := FMTSpace.Fields.Fields[K].Value; FMTSpace.Next; end; try TFDFunction.QryExecute(qryDistanceIns, True); finally FreeAndNil(qryDistanceIns); end; Unfortunately, the instructions and examples are more than brief. They are not complete. Thanks! Share this post Link to post
corneliusdavid 214 Posted February 17, 2022 I haven't tried this and am just thinking out loud but couldn't you use a FDBatchMove component and save yourself some code? It seems like you could set up a Dataset Reader and Writer and then just tell it to go. Share this post Link to post
Stano 143 Posted February 17, 2022 There was no other option than FDBatchMove. It already works for me. Thanks for the response. Share this post Link to post
Uwe Raabe 2057 Posted February 17, 2022 There also is TFDDataSet.CopyDataSet, which takes any TDataSet as source. So if your target dataset is derived from TFDDataSet (like TFDQuery) this could be an option. Share this post Link to post
Stano 143 Posted February 17, 2022 Not for me. The SQL has "0 AS X". The actual field type in DB is Float. Therefore, I always define the MemTable structure for each use. As I was explained, Pointer is passed to CopyDataSet. Field type data is lost. X will be ftInteger. I don't have to deal with performance. These are just a few records / rows. Share this post Link to post
Guest Posted February 17, 2022 Sorry for barging in to you thread but i want to ask, do you have the sources for FireDAC? Share this post Link to post
Guest Posted February 17, 2022 So you have no way of finding out problems on your own. You have to post here or wait for Emba paid support? 1½ years for one fix if you are lucky? I would not deploy something that way. The level of control is is the basement IMHO. Yesterday i had to make an MVP using FireDAC and it was kind of "simple". I spent 2 hours (!) to find out how to extract field result data from an FDCommand. The docs where either not accessible (see other threads) or seriously lacking (local). For me this is like working with blinders on. My question is, how do you sleep at night when you cannot se the code? Share this post Link to post
corneliusdavid 214 Posted February 17, 2022 1 minute ago, Dany Marmur said: how do you sleep at night when you cannot se the code This seems a little harsh. I use a lot of code that others have written and which I cannot see (or haven't looked at). I sleep just fine at night. I don't have time to personally look at and test everyone else's code but trust that it works as described. Of course, it's wise to test the finished product that uses unseen code modules to make sure the end result is what you're after. In this case, there's a specific problem for which an answer is being sought and being able to see what the components do by looking at the code could help but will it actually take less time tracing through thousands of lines of unfamiliar classes than it would to post a question on a forum? Share this post Link to post
Guest Posted February 17, 2022 @corneliusdavid, yes. Most definitely. 30 years of Delphi usage and all the tickets... all of them, ALL, i had to make an MVP to get it fixed. Without sources i would not have been able to help the vendor fix. They go... "you are confused". You have a lot of trust in your 3rd party vendors. Me... i realize they are on the same level as myself. For each 3rd party that i have deployed, i have worked with their support for 2 years before deploying. I must "vett" each one to see if they are up to the task. If you want "cases", i have some 🙂 not just some, but a lot. Also, i will realize and cater for the fact that some applications in the Delphi-house-world is click-and-go. But that is not scalable neither maintainable. Share this post Link to post
Stano 143 Posted February 17, 2022 I write here again that I am not a programmer. I seldom understand foreign code. The reason for asking the question: it's hard to find something, especially FireDAC, in help. Examples are: about something other than the topic very complicated incomplete, possibly with errors I couldn't find anything. I was successful later. I forgot to write it here. Thanks to all. Share this post Link to post
Guest Posted February 17, 2022 (edited) remembering that you can MAP/Rule your fields on FDManager (or in subclass like FDQuery on rule/map options) to convert automatically one type to other if necessary. Edited February 17, 2022 by Guest Share this post Link to post
Stano 143 Posted February 17, 2022 Defining field types in MemTable and retrieving data using CopyDataSet is the easiest for me. Only now did I realize that I had written nonsense in Uwe Rabe's answer. I meant MemTable.Data := MyQuery.Data. No CopyDataSet. I apologise. Share this post Link to post