Subject Search mode and table aliases
Author Aleš Kahánek
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@...