You are not logged in.
Pages: 1
I have understand how retrive data from a table but now I must retrive data with a complex SQL from many tables:
SELECT Persons.LastName, Persons.FirstName, Orders.OrderNo
FROM Persons
LEFT JOIN Orders
ON Persons.P_Id=Orders.P_Id
ORDER BY Persons.LastName
Can you explane how can I do it?
Offline
You can use this overridden method of any TSQLRestClient client:
...
/// Execute directly a SQL statement, expecting a list of resutls
// - return a result table on success, nil on failure
function ExecuteList(const Tables: array of TClass; const SQL: RawUTF8): TSQLTableJSON; virtual; abstract;
Use [TSQLPersons,TSQLOrders] in the Tables parameters (for the internal caching mechanism, but it's not mandatory).
Post your SQL request in the SQL parameter.
It will return a TSQLTableJSON instance to you, in which you'll have all the resulting rows.
Offline
Pages: 1