Report Workshop - table aliases not working

General TRichView support forum. Please post your questions here
Post Reply
whswowis
Posts: 1
Joined: Wed Mar 30, 2011 3:34 pm

Report Workshop - table aliases not working

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Report Workshop - table aliases not working

Post 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.
Post Reply