Subject | Re: please help with FieldsDisplayLabel and OrderingLinks |
---|---|
Author | Marco Menardi |
Post date | 2003-09-04T12:01:02Z |
--- In IBObjects@yahoogroups.com, "Michael Fung" <ibo@c...> wrote:
must provide to Firebird a NON AMBIGUOUS field reference.
So in OrderingItems you must provide table names too, like:
NAME=C.NAME
BRAND NAME=B.NAMEor whatever you like.
To check what ibo does, use the SQL monitor and have a look at the
query generated when you change OrderingItemNo. If you see a "ORDER BY
<ambiguous fieled name here>" you know that Firebird will reject it.
In addition, as a free suggestion, consider that if you make
intelligent use of domains, there is the wonderful possibility to
define a lot of properties related to domains at the IB_Connection
level, to gain a lot of time, consistency and error free developement.
regards
Marco Menardi
> Dear all,This is a problem not related with FieldsDisplayLabel, it's that you
>
> I used IB_Connection.FieldsDisplayLabel to set the grid column title
> globally, like that:
>
> Brand.Name=Brand
> Category.Name=Category
> Currency.Name=Currency
> Package.Name=Package
> Unit.Name=Unit
>
>
> It worked like a charm. So I didn't bother to name the fields in all
> queries, like that:
>
> SELECT P.ID
> , P.PN
> , B.NAME
> , K.NAME
> , C.NAME
> , P.PHY_QTY
> , U.NAME
>
> FROM PRODUCT P
> LEFT OUTER JOIN BRAND B ON B.ID = P.BRAND_ID
> LEFT OUTER JOIN PACKAGE K ON K.ID = P.PACKAGE_ID
> LEFT OUTER JOIN CATEGORY C ON C.ID = P.CATEGORY_ID
> LEFT OUTER JOIN UNIT U ON U.ID = P.UNIT_ID
>
> However, when I come to setup Ordering for the queries, it doesn't
> work becuase of the same 'NAME' fields!
>
> Is there a workaround? Could you save me from rewriting all qeries,
> please?
>
> TIA,
> Michael
must provide to Firebird a NON AMBIGUOUS field reference.
So in OrderingItems you must provide table names too, like:
NAME=C.NAME
BRAND NAME=B.NAMEor whatever you like.
To check what ibo does, use the SQL monitor and have a look at the
query generated when you change OrderingItemNo. If you see a "ORDER BY
<ambiguous fieled name here>" you know that Firebird will reject it.
In addition, as a free suggestion, consider that if you make
intelligent use of domains, there is the wonderful possibility to
define a lot of properties related to domains at the IB_Connection
level, to gain a lot of time, consistency and error free developement.
regards
Marco Menardi