Page 1 of 1

Delphi - Using TMSTable with a SQL JOIN Statement results in error

Posted: Mon 15 Oct 2018 11:32
by B.T.
After calling "Edit" on our Table it throws the error that a readonly Dataset can't be modifed.
The problem only occurs, if we have a JOIN in our statement.

Code: Select all

  TMyOwnTable = class(TMSTable)
...
var
  table: TMyOwnTable;
  sqlStatement: TStringList;
...
  sqlStatement.Add('SELECT TOP 100 master.* FROM (SELECT master.*, n2.Description AS Descr2 FROM MYTABLE master ');
  sqlStatement.Add('LEFT JOIN MYTABLE n2 ON master.JOINCOLUMN = n2.JOINCOLUMN) master');
  table.TableName := 'MYTABLE';
  table.UpdatingTable := 'MYTABLE';
  table.SQL.Assign(sqlStatement);
  table.Open;
  table.Edit;
In version 7.3.16 everything worked just fine.
With the newest version for Delphi 10.2 it doesn't. (8.1)

Thanks in regards
B.T.

Re: Delphi - Using TMSTable with a SQL JOIN Statement results in error

Posted: Wed 17 Oct 2018 07:24
by Stellar
The server can return a resulting dataset with the ReadOnly flag set, then SDAC will set the ReadOnly flag for the dataset. For a more detailed analysis of this behavior, please compose a small sample demonstrating the issue and send it to us, including database objects creating scripts.
You can send the sample using the contact form at our site: devart.com/company/contactform.html