Subject Re: [IBO] Search mode and table aliases
Author Jason Wharton
I wonder if you would not mind tracing into the code in IB_Parse.pas and see
if you can suggest a fix for this.

Thanks,
Jason Wharton
CPS - Computer Programming Solutions
Mesa Arizona
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --

----- Original Message -----
From: "Aleš Kahánek" <ales.kahanek@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, April 06, 2003 11:52 PM
Subject: [IBO] Search mode and table aliases


> Hi,
> I just found a problem with Query by example searching when multiple
tables
> are queried like in the following query (the original query is little bit
> more complex)
>
> SELECT LEADER.FULLNAME AS LEADER_NAME
> , GARANT.FULLNAME AS GARANT_NAME
> , EVENT.NAME
> FROM EVENT
> JOIN PERSON LEADER ON EVENT.LDR_ID = LEADER.PER_ID
> JOIN PERSON GARANT ON EVENT.GAR_ID = GARANT.PER_ID
>
> When trying to search via the QBE, IBO generates this query
>
> SELECT LEADER.FULLNAME AS LEADER_NAME
> , GARANT.FULLNAME AS GARANT_NAME
> , EVENT.NAME
> FROM EVENT
> JOIN PERSON LEADER ON EVENT.LDR_ID = LEADER.PER_ID
> JOIN PERSON GARANT ON EVENT.GAR_ID = GARANT.PER_ID
> WHERE UPPER( LEADER_NAME ) STARTING 'ENTERED_TEXT'
>
> and this raises exception 'column LEADER_NAME not found'.
>
> Proper where section should be
> WHERE UPPER( LEADER.FULLNAME ) STARTING 'ENTERED_TEXT'
>
>
> Problem is that I have to define aliases for the collumns (LEADER_NAME,
> GARANT_NAME) which is the only way to define DataField property of
TIB_Edit
> in this case. If I would not define the aliases, the combobox for
DataField
> property would show PERSON.FULLNAME twice.
>
> IBO constructs the fieldname using the "FieldAliasname" instead of
> "AliasTable.SQLFieldName".
>
> Did anyone encounter this behaviour?
>
> Thank for any hints.
> Ales
> akahanek@...