Subject Re: [IBO] TIB_Qry and Multiple Rows...
Author Helen Borrie
At 05:26 AM 30/03/2007, you wrote:
>Hello Friends.
>
>I have a TIB_Query with following SQL:
>
>SELECT CTTALHAO.COD_TALHAO,
> CTTALHAO.DESCRICAO,
> CTTALHAO.HA_TALHAO,
> CTTALHAO.COD_PROPRIEDADE,
> CTTALHAO.COD_LOCAL,
> CTTALHAO.COD_INSC
> FROM CTTALHAO
>
>In KeyLinks:
>
>CTTALHAO.COD_PROPRIEDADE=CTPROPRIEDADE.COD_PROPRIEDADE

This is wrong. It should be the unique key of the dataset
(COD_TALHAO, I assume).

>
>In MasterLinks:
>
>CTTALHAO.COD_PROPRIEDADE=CTPROPRIEDADE.COD_PROPRIEDADE
>
>The property KeySource and MasterSource, linked to the same
>datasource and the property CachedUpdates as true.

Leave KeySource Nil. You would use KeySource for a lookup key to a
different table. KeySource and MasterSource would never point to the
same datasource.

>
>When I am navigating in the registrations the following message appears:
>
>Multiple Rows in singleton fetch
>
>Check KeyLinks and JoinLinks properties

Correct the KeyLinks. That is the reference that is causing the
Multiple Rows error. And nil the KeySource property.

You have no JoinLinks, so ignore that.

>"My SQL appears here, following for:"
>Where CTTALHAO.COD_PROPRIEDADE=?/*BIND_0*/

If the MasterSource and MasterLinks settings are correct,
MasterSource should be pointing to the datasource for the
CTPROPRIEDADE dataset. The CTPROPRIEDADE dataset should have
COD_PROPRIEDADE as its KeyLinks.

Please go back to the sample that I sent you and follow what I did there.

Helen