Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: How to access a nested dataset in an FDQuery?


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


Permlink Replies: 2 - Last Post: Feb 8, 2016 10:40 AM Last Post By: Christian Stück...
Christian Stück...

Posts: 2
Registered: 1/19/06
How to access a nested dataset in an FDQuery?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 7, 2016 7:45 AM
Hi!

I have a PostrgreSQL table with a column that contains an array of text (datatype = text[]).
When i select that table with an FDQuery, an access the field via FDQuery1.Fields[3].AsString, i get: "(DATASET)"

So i suppose, it's a nested dataset, but how do access that dataset?

I'd like to do something like this with the nested dataset:
while not FDQuery2.Eof do
begin
... do stuff
FDQuery2.Next;
end;

Thank you for your help!
Chris
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: How to access a nested dataset in an FDQuery?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 7, 2016 10:50 PM   in response to: Christian Stück... in response to: Christian Stück...
var
  oDS: TDataSet;
...
oDS := TDataSetField(FDQuery1.Fields[3]).NestedDataSet;
while not oDS.Eof do
begin
  // do stuff
  oDS.Next;
end;


--
With best regards,
Dmitry
Christian Stück...

Posts: 2
Registered: 1/19/06
Re: How to access a nested dataset in an FDQuery?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 8, 2016 10:40 AM   in response to: Christian Stück... in response to: Christian Stück...
Perfect, thanks!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02