Re: join conditions for files
- From: Bernhard Sander <fuchs@xxxxxxx>
- Date: Tue, 21 Apr 2009 15:06:22 +0200
Hi Mohan,
I was trying the following command:
sele a.csno,dlr_code,b.* from pnw10409 a,opmain b,dist_mas where dist_mas.
dlr_code$b.dorno and b.dcd='I904' and a.csno=b.csno dist
This works in Fox 2.6, but not in VFP ( SQL: Internal error)
The problem is in the join condition with '$'
The join condition is ----- ANY(dlr_code) from dist_mas should be found in
field dorno from opmain
The specifications for the join condition seem to preclude this sort of a
join, but it works in Fox2.6 ( and correctly!)
Maybe $ is not allowed in a join condition, I don't know exactly. But SQL LIKE is allowed and a UDF is allowed.
The LIKE way would go like this:
SELCT aa.csno,dlr_code, bb.* FROM pnw10409 aa, opmain bb, dist_mas ;
WHERE bb.dorno LIKE "%" + dist_mas.dlr_code + "%" and bb.dcd='I904' and aa.csno=bb.csno
From the help I'm not sure, whether it will work!
The UDF way would go like this:
SELCT aa.csno,dlr_code,bb.* FROM pnw10409 aa, opmain bb, dist_mas ;
WHERE yourudf(dist_mas.dlr_code, bb.dorno) and bb.dcd='I904' and aa.csno=bb.csno
FUNCTION yourudf(tcContained, tcContains)
RETURN tcContained $ tcContains
ENDFUNC
Yet another way:
SELCT aa.csno,dlr_code,bb.* FROM pnw10409 aa, opmain bb, dist_mas ;
WHERE AT(dist_mas.dlr_code, bb.dorno) > 0 and bb.dcd='I904' and aa.csno=bb.csno
Another hint:
Don't use local aliases made of one letter only, they may confuse Foxpro, since they are reserved names for workspace aliases.
Regards
Bernhard Sander
.
- Follow-Ups:
- Re: join conditions for files
- From: bnmohan via DBMonster.com
- Re: join conditions for files
- References:
- join conditions for files
- From: bnmohan via DBMonster.com
- join conditions for files
- Prev by Date: join conditions for files
- Next by Date: Re: Clever Idea Needed
- Previous by thread: join conditions for files
- Next by thread: Re: join conditions for files
- Index(es):
Relevant Pages
|