Subject | Re: [IBO] Re:TCDSProvider does not like TIBOQuery |
---|---|
Author | Helen Borrie |
Post date | 2010-08-16T05:14:45Z |
At 04:00 PM 16/08/2010, you wrote:
This one is fine (especially if you omit the typing errors):
You must start thinking about the *sets* that your applications work with, not tables. Your IBOQuery objects want to know which column[s] in the *set* to use to identify each row of the dataset uniquely.
HB
>This following query generate error message ...Qry_xxx: Field 'Cust_Code' notSomehow, you are providing the (wrong) information to the query about the key fields. If you supply Cust_Code as any sort of field name for a set that does not contain a field of that name, of course you can expect an error.
>found
>Select Curr_code, sum(AR_Amount)TotAmt
> From AccRcv
>Group Curr_code
>Having sum(AR_Amount) > 0
>if I include Cust_Code on the select list this will be okay,If you just want to get the totals for each currency then keep Cust_Code out of the query!
>Select Cust_code, Curr_code, sum(AR_Amount) TotAmt
> From AccRcv
>Group Cust_code, Curr_code
>Having sum(AR_Amount) > 0
>
>However it is generate different result set which I do not want,
>because I want sum up the amount by Curr_code only
>instead of by Cust_Code, Curr_code
This one is fine (especially if you omit the typing errors):
>Select Curr_code, sum(AR_Amount) TotAmtThe Keylinks for this set would be Curr_code, NOT the compound primary key of the underlying table.
> From AccRcv
>Group by Curr_code
>Having sum(AR_Amount) > 0
You must start thinking about the *sets* that your applications work with, not tables. Your IBOQuery objects want to know which column[s] in the *set* to use to identify each row of the dataset uniquely.
>Thank you for your time and thoughtNo more from me, sorry: too many urgent things to do. My advice: do some more research and try to understand sets a bit better.
HB