Subject | Re: [firebird-support] Re: Potential union problem |
---|---|
Author | Robert martin |
Post date | 2005-09-05T20:53:43Z |
Hi Svein
The 'AS Tablesrce' is just so the application can tell which table the
record is from. I didn't realize I could get away with not having it is
the second part :), thanks thats good to know. The problem isn't with
user rights unfortunately as the same screen correctly shows records
from both tables individually fine.
Any one else have any suggestions?
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Svein Erling Tysvær wrote:
The 'AS Tablesrce' is just so the application can tell which table the
record is from. I didn't realize I could get away with not having it is
the second part :), thanks thats good to know. The problem isn't with
user rights unfortunately as the same screen correctly shows records
from both tables individually fine.
Any one else have any suggestions?
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Svein Erling Tysvær wrote:
>Could this be due to certain users not being granted SELECT to one of
>the tables? Just guessing...
>
>It is always a good idea to alias table and field names (even though I
>don't think it should be necessary in your case). And why 'as
>TableSrce' for the second part of the union (though it ought not to
>matter)?
>
>Set
>
>
>>SELECT DRTRANSREF, ENTITYREF, 'D' as TableSrce
>>FROM DebtorTrans
>>WHERE EntityRef = 436
>>UNION
>>SELECT DRTRANSREF, ENTITYREF, 'C' as TableSrce
>>FROM CompletedDebtorTrans
>>WHERE EntityRef = 436
>>ORDER BY 14 DESC, 5 DESC;
>>
>>
>>
>
>