Subject RE: [IBO] Singleton select error
Author Daniel R. Jimenez
> We have a DB app, which allows users to browse a record (call it record
> A).
> This record (A) has a FK to another table, so the FK is a TIB_LookupCombo.
>
> Say the application user was to open the form which allows him/her to
> browse
> the above mention record (A). Say that the application user also opens
> another form to edit the content of the FK record (call it record B)
> reference by record (A).
>
> Once she/he has modified record (B) and committed the changes. The
> application calls RefreshAll() on the query responsible for the dropdown
> (TIB_LookupCombo), at this stage I am getting a Singleton error but I am
> not
> sure how this is possible. On the other hand, if I use Unprepare, Prepare
> and Execute the error no longer appears, but the TIB_LookupCombo no longer
> displays the FK record(B) associated to record (A) as selected, it just
> appears as one of the available records in the dropdown.
>
>
> I am not sure if the above description of the problem is sufficient. If
> not
> please ask for the any further information you require.
>
> Thank you
>
> Daniel.
>

I have notice that in my original SQL for the IB_Query responsible for the
dropdown was:

SELECT DISTINCT
USERS_GROUP_LINK.UGL_USERS_ID,
USERS.USERS_NAME,
FROM
USERS_GROUP_LINK
INNER JOIN
USERS
ON
USERS_GROUP_LINK.UGL_USERS_ID=USERS.USERS_ID
AND
USERS_GROUP_LINK.UGL_UG_ID=2

And the KeyLinks property had:

UGL_USERS_ID=PROSPECT.PROSPECT_USERS_ID_OWNER

If I modify the SQL to be:

SELECT DISTINCT
USERS_GROUP_LINK.UGL_USERS_ID,
USERS.USERS_NAME,
USERS.USERS_ID // This is the only difference to the original SQL
FROM
USERS_GROUP_LINK
INNER JOIN
USERS
ON
USERS_GROUP_LINK.UGL_USERS_ID=USERS.USERS_ID
AND
USERS_GROUP_LINK.UGL_UG_ID=2

The problem goes away. Why????


Thank you

daniel