Hi,
I have two entities TMaster (master)
and TDetail (detail) and I would like to retrieve the list of masters
(TList<TMaster>) having detail (TDetail). I don't find neither
Aurelius nor XData Client syntax to request entity list like:
SELECT * FROM Master WHERE MasterID IN (
SELECT MasterID FROM Detail)
Any idea? Thank you.
Regards,
wlandgraf
(Wagner Landgraf)
August 5, 2019, 9:01pm
2
There is no such syntax, unfortunately. You should use SQL condition for that and add that criteria directly using SQL.
Hi Wagner,
Unfortunately, it does not work. I have the following error:
SQL error code=-104 Token unknown IN
TXDataOperationContext.Current.GetManager.Find<TMaster>
.Where(Linq.Sql('MasterD IN (SELECT MAsterID IN Detail )'));
wlandgraf
(Wagner Landgraf)
August 6, 2019, 1:32pm
4
I guess it should be "Select masterId from Detail", not "Select masterId In Detail"?
Of course, it's stupid! I was focused on the first IN of the query.
It works fine. Thank you very much.