Subject | Re: [ib-support] Re: Timeout (?) problem |
---|---|
Author | Tim Ledgerwood |
Post date | 2003-04-29T11:48:15Z |
> > WHERE l.Tran_Type LIKE '#%'Question : Do I have to include the alias name in selects from single
> > AND Misc_Trans = 0
> > AND l.Sal_Ref = 'S'
> > AND l.POS_ID = :POSID
> > AND SHIFTNUM = :SHIFTNUM
> > GROUP BY l.Stok_Code, l.Descrip, s.Amount, l.Dept_Code
> > ORDER BY l.Descrip
>
> There are two lines in Where clause where columns are used without
>table aliases. It is so-called ambigious query which can unpredictably
>return wrong or correct results. Such a queries are prohibited in
>dialect 3 databases in FB but are made temporarily acceptable in
>dialect 1 to compatibility with old applications migrated from Borland
>IB. It is most probable reason, especially if there are columns with
>this names in both tables. Alter procedure being sure applications
>which use it are not connected at this moment. If it will'nt help (I
>never encountered such a behaviour, just guesses based on vague
>recollections of discussions):
tables as well?
In other words, should I write
FOR SELECT
Stok_Code, Dept_Code, SUM(mquantity) AS mtotal,
SUM(uquantity) AS utotal
FROM log
WHERE
log.TRAN_TYPE IN ('#R', '#T')
AND log.SHIFTNUM = :SHIFTNUM
instead of
FOR SELECT
Stok_Code, Dept_Code, SUM(mquantity) AS mtotal,
SUM(uquantity) AS utotal
FROM log
WHERE
TRAN_TYPE IN ('#R', '#T')
AND SHIFTNUM = :SHIFTNUM
[Non-text portions of this message have been removed]