Jump to content

Mark Williams

Members
  • Content Count

    290
  • Joined

  • Last visited

Everything posted by Mark Williams

  1. Mark Williams

    TFDBatchMove delete records

    I was configuring the Batchmove as follows: FBatchMove := TFDBatchMove.Create(nil); FReader := TFDBatchMoveDataSetReader.Create(FBatchMove); FWriter := TFDBatchMoveSQLWriter.Create(FBatchMove); try FReader.DataSet:=FDQueryPG; FWriter.Connection:=FDConnectionPG; FWriter.TableName:='dummy'; FBatchMove.Mode := dmDelete; FBatchMove.Execute; I assumed (obviously incorrectly) that the batchmove component would only delete the records with an update status of usDeleted. I assume there is a way of configuring it for specific ideas, however, I have had so muh trouble with BatchMove that I have completely moved away from it now and using Array DML instead which is so much less hassle.
  2. I am trying to work with integer arrays in a Postgres integer[] field. I have read somewhere that with Postgres you need to use NestedDataSets to read the data rather than TArrayField and that seems to be correct. I can successfully write back to the dataset using TArrayField in an Insert Query. I can read from the integer[] field using TDataSet and nested fields. However, I cannot work out how to write to the TDataSetField. I have tried the following: Edit; TT:=TDataSetField(Fields[2]); for i:=0 to high(arr) do begin TT.NestedDataSet.Append; TT.NestedDataSet.Fields.Fields[0].Value:=arr[i]; end; The error I get on trying to post data edited as above is I tried to use "AsInteger" instead of value, but got the same error.
  3. Mark Williams

    TFDBatchMove delete records

    It's too slow for large updates.
  4. Mark Williams

    Mark post as answered

    Is there anyway of indicating that a post has been answered in this forum?
  5. Mark Williams

    FireDAC paramamania

    I am having difficulties with a parameterized query designed to be used repeatedly. It works first time but never a second. The query is fairly complicated so I prepare it on app initialization for repeated use, but it works just once and returns an empty dataset on every other occasion (even with the same parameter). If I reset the query text (FDQuery.SQL.Text := FDQuery.SQL.Text) it works as expected. That rather defeats the purpose of preparing the query in advance. Is it the case that parameters cannot be used in repeated queries?
  6. Mark Williams

    FireDAC paramamania

    So simple! Thanks.
  7. Mark Williams

    FireDAC clearDetails or EmptyDataSet

    I have been using ClearDetails to remove all records from TFDQuery components. However, I have experienced a problem today where a call to ClearDetails for a reusable query that is designed to return a single record is not removing that record. The description for this function states: Pretty much what I was expecting it to do, but (in this one case at least) it is not. I have switched to EmptyDataSet which does the job, but should I be updating all places where I use ClearDetails to update to EmptyDataSet?
  8. Mark Williams

    FireDac PostgreSQL and TBatchMove

    That's good to know. Thanks. Have you any experience of Batchmove and reverse inrements?
×