Paradox Community

Items in pnews.paradox-dos

Subject:Re: self join
Date:Sun, 14 Feb 2021 23:47:02 +0000
From:Michael Kennedy <Info@KennedySoftware.ie>
Newsgroups:pnews.paradox-dos
Dang!

Yes - and matching on a $-field is also weird!!

I set up a table and tried it (but used only integer values in the 
Rebate field!), and had the same result as yourself:

   - With the "_r" entries in the query, the query changed ALL "USD" 
rows to the first value, and LL the Non-USD rows to the second value. 
So, as I understand it, it did NOT honour the "_r" matching requirement!

   - Without the "-r" match, the query was still accepted, and the 
result was exactly the same.

Not good, I think!

But, as you and Steve have stated, in this specific case, two simple 
changeto queries could be used.

   - Michael.


On 14/02/2021 10:54, Bernie van't Hof wrote:
> Me too!
> 
> The Rebate column is actually type $, so makes even less sense.
> 
> This query is over 25 years old and it is entirely possible that when it 
> was written I was guessing a bit.
> 
> It does seem to work the same with or without the _r links, so they 
> appear to do nothing. But that just doesn't feel right.
> 
> 
> On 14/2/21 10:51 am, Michael Kennedy wrote:
>> I haven't tried that, Bernie, but maybe PDoxDOS will reject the query 
>> with something like "Query has unrelated Rows...", if the "_r" is 
>> omitted?
>>
>> On the other hand, is the query seeking rows where it'll change the 
>> FxRate, only if it finds some rows with USD, A-N-D some without USD, 
>> for the SAME Rebate code? If so, then, if all the entries for a Rebate 
>> code have USD, or if all the entries do not have USD, it will not 
>> change the FxRate?
>>
>> Or am I totally confusssssed?!!
>>
>> Wow!
>>
>> --------------
>>
>> Running separate queries sounds OK to me, though it might be a little 
>> slower on large tables.
>>
>>    - M
>>
>>
>> On 13/02/2021 07:09, Bernie van't Hof wrote:
>>> I don't (yet) handle multi-row queries so this was rejected:
>>>
>>>     Query
>>>
>>>       Vend_Reb | Rebate | Curr      | FxRate           |
>>>                | _r     | "USD"     | CHANGETO ~FxRate |
>>>                | _r     | NOT "USD" | CHANGETO 1      
|
>>>
>>>      Endquery
>>>
>>> Easy. Just (for now) split the query.
>>>
>>> But whats that _r link intending?
>>> I tried with and without and the results seem to be the same.
>>>
>>> - Bernie


Copyright © 2004 thedbcommunity.com