Page 1 of 1

Report Workshop - table aliases not working

Posted: Mon May 14, 2018 12:23 pm
by whswowis
Hi,
we are using dbexpress components (MS SQL server) to get data for Report Workshop, but I'm not able to use table aliases.

not working:
select us1.USER_ID as USER_ID, us1.USER_NAME1 as USER_NAME1 from USERS as us1
working:
select USERS.USER_ID as USER_ID, USERS.USER_NAME1 as USER_NAME1 from USERS as USERS

The problem is we and our customers have hundreds of very complex queries (using a lot of joins) which need the short table aliases syntax because they are created by a special query builder software.
Do you have any ideas why it is not possible to use aliases even if it's an allowed sql syntax? The queries work properly in other program parts where we still use TRichView components.

Re: Report Workshop - table aliases not working

Posted: Mon May 14, 2018 4:54 pm
by Sergey Tkachenko
If you see (in RVReportDBXDataProvider.pas) how TRVReportDBXDataProvider is implemented, you will see that it creates TSQLQuery and assigns your data query to its SQL.Text.

So if aliases work in TSQLQuery, they must work in TRVReportDBXDataProvider as well.