Subject Re: [IBO] TIB_Lookup and multiple keys
Author Helen Borrie (TeamIBO)
At 01:42 AM 25-03-02 +0000, you wrote:
>I can't understand the following behaviour.
>
>A TIB_Grid has two embedded TIB_LookupCombos. Each lookup dataset has
>two prime keys and the SQL statement supporting the grid has two
>emebedded select statements. I am sure that the KeySource, KeyLinks
>and KeyDescLinks have been defined properly.
>
>When updating a record the grid, a record can be selected from each
>of the embedded TIB_LookupCombo controls but the moment the record in
>the grid is posted the values displayed for the looked up values
>changes to incorrect values. Clicking on the column containing the
>lookupcombo causes the lookupcombo to be displayed with the correct
>value but clicking on any other column causes the lookup value to be
>incorrect (obviously the lookupcombo is not displayed when the column
>is no longer selected).
>
>Changing this so that the lookup datasets only use one key and
>everything works fine.
>
>Main query for grid is:
>-------------
>part of SQL:
>
>SELECT ...
> ...
> ORL_TMP_WHO_REF,
> ORL_TMP_WHO_SREF,
> (SELECT WHO_DESC FROM WAREHOUSES W1
> WHERE W1.WHO_UNIQUE_REF = O1.ORL_TMP_WHO_REF AND
> W1.WHO_SYSTEM_REF = O1.ORL_TMP_WHO_SREF) as WAREHOUSE,
> ORL_TMP_WLOC_REF,
> ORL_TMP_WLOC_SREF,
> (SELECT WLOC_DESC FROM WLOCATIONS W2
> WHERE W2.WLOC_UNIQUE_REF = O1.ORL_TMP_WLOC_REF AND
> W2.WLOC_SYSTEM_REF = O1.ORL_TMP_WLOC_SREF) as LOCATION
>FROM ORDERLINES O1
>
>Lookup1
>-------
>SQL is:
>SELECT WHO_UNIQUE_REF
> WHO_SYSTEM_REF
> WHO_DESC
>FROM WAREHOUSES
>ORDER BY WHO_DESC
>
>KeyLinks:
>WAREHOUSES.W1.WHO_UNIQUE_REF = ORDERLINES.ORL_TMP_WHO_REF
>WAREHOUSES.W1.WHO_SYSTEM_REF = ORDERLINES.ORL_TMP_WHO_SREF

Doesn't look right. Take out the "W1" - it doesn't belong here. A Keylink
has to evaluate to a valid WHERE clause segment and refer to the actual table.


regards,
Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at
www.ibobjects.com