Subject Re: [IBO] Re:TCDSProvider does not like TIBOQuery
Author Helen Borrie
At 12:41 PM 15/08/2010, you wrote:
>Hi Helen,
>This is typo error on my email, however my TIBOQuery is correct, as follow.
>
>Select sum(amount) Tamt from SaleRevenue
>where region = 'West'
>
>
>Problem: TIBOQuery looking for the primary key
>that is not listed in the select clause

It's looking for a unique key, not necessarily the Primary key. A set with only one non-unique field is no use to a client application.

Try

select sls_id, sum (amount)
from SaleRevenue
Where region = 'West'
group by 1

and set the KeyLinks property explicitly to sls_id

Note that this is NOT an updatable set so it's possible that the TCDSProvider is set to read-write and is complaining because it cannot establish a key field on which to base a searched update.

HB