firedac master - detail relationship doesnt work
<p>First definition of database tables:</p>

<pre><code>CREATE TABLE UNCERTAINTY
(
  ID Integer NOT NULL,
  NAME Varchar(240) CHARACTER SET NONE NOT NULL,
  CONSTRAINT PK_UNCERTAINTY PRIMARY KEY (ID),
  UNIQUE (NAME)
);

CREATE TABLE UNCERTAINTYDETAIL
(
  ID Integer NOT NULL,
  UNCERTAINTY_ID Integer NOT NULL,
  MEASTYPE Varchar(255) CHARACTER SET NONE,
  CONDITION Varchar(255) CHARACTER SET NONE,
  POWERFACTOR Double precision,
  LOADTYPE Varchar(255) CHARACTER SET NONE,
  UNCERTAINTY Double precision,
  CONSTRAINT PK_UNCERTAINTYDETAIL PRIMARY KEY (ID)
);

ALTER TABLE UNCERTAINTYDETAIL ADD CONSTRAINT FK_UNCERTAINTY_UNCERTAINTYDETAI
  FOREIGN KEY (UNCERTAINTY_ID) REFERENCES UNCERTAINTY (ID) ON DELETE CASCADE;
</code></pre>

<p>And now definition of my data sources and queries in dfm file:</p>

<pre><code>object FDQuery1: TFDQuery
  Connection = Connection1
  SQL.Strings = (
    'select * from UNCERTAINTY'
    'order by NAME')
  Left = 125
  Top = 239    
end
object FDQuery2: TFDQuery
  MasterSource = DataSource1
  MasterFields = 'ID'
  Connection = Connection1
  SQL.Strings = (
    'select * from UNCERTAINTYDETAIL'
    'where UNCERTAINTY_ID=:param1'
    'order by ID')
  Left = 456
  Top = 224
  ParamData = &lt;
    item
      Name = 'PARAM1'
      ParamType = ptInput
    end&gt;
end
object DataSource1: TDataSource
  DataSet = FDQuery1
  Left = 53
  Top = 239
end
object DataSource2: TDataSource
  DataSet = FDQuery2
  Left = 392
  Top = 224
end
</code></pre>

<p>Both data sources are connected to db grids.</p>

<p>In FormShow event I call following methods:</p>

<pre><code>FDQuery1-&gt;Open();
FDQuery2-&gt;Open();
</code></pre>

<p>The master grid displays correctly all items stored in table UNCERTAINTY but detail grid is always empty. Why ?</p>