Jump to content
Mark Williams

FireDac writing to TDataSetField's NestedDataSet

Recommended Posts

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

Quote

Cannot read data from or write data to the invariant column [page_array]. Hint: use properties and methods, like a NestedTable.

I tried to use "AsInteger" instead of value, but got the same error.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×