General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hello,this is a documented bug in foxpro, when collating is other than machine,
or when you use index tags created with other tags than machine!
I usually use machine collating index tags and only hungarian tag on name column, avoiding this problem.
And machine collating during sql select. To get alphabetical listing I do an extra sorting with hungarian collating.
See msdn.microsoft.com and search for collating keyword
bb
>Hi!
>
>I'm running VFP6 (SP5) on Czech Windows 98 SE and have the following problem
>in SQL-SELECT with comparing character data from these tables:
>- two tables in the FoxPro 2.6 (DOS) format, code page 895 (Kamenicky)
> with structure (Klic Character 1, Value Numeric 3) and 256 records
> with values from CHR(0),0 to CHR(255),255. These tables are identical.
> They have no indexes.
>
>After running the following code
>
> SET COLLATE TO "MACHINE"
> USE i:\fox\keys IN 0 SHARED
> USE i:\fox\keys2 IN 0 SHARED
>
> sele * FROM KEYS K1, KEYS2 K2 ;
> WHERE K1.Klic == K2.Klic ;
> ORDER BY 2
>
>I get only 245 records in the result with statements that 176=95, 177=95,
>record for code 172 is missing etc. I expected 256 records with identical
>values :-((
>
>By modifying the code to the following
>
> SET COLLATE TO "MACHINE"
> USE i:\fox\keys IN 0 SHARED
> USE i:\fox\keys2 IN 0 SHARED
>
> SELECT Keys
> SET NOCPTRANS TO Klic
> SELECT Keys2
> SET NOCPTRANS TO Klic
>
> sele * FROM KEYS K1, KEYS2 K2 ;
> WHERE K1.Klic == K2.Klic ;
> ORDER BY 2
>
>I get only 128 records in the result (for codes 0 - 127).
>
>After getting the code to the following variation (much slower in run)
>
> SET COLLATE TO "MACHINE"
> USE i:\fox\keys IN 0 SHARED
> USE i:\fox\keys2 IN 0 SHARED
>
> SELECT Keys
> SET NOCPTRANS TO Klic
> SELECT Keys2
> SET NOCPTRANS TO Klic
>
> sele * FROM KEYS K1, KEYS2 K2 ;
> WHERE MyFun(K1.Klic,K2.Klic) ;
> ORDER BY 2
>
> FUNCTION MyFun
> LPARAMETERS tc1,tc2
>
> RETURN tc1==tc2
>
>I finally got the correct result (256 records with identical values).
>
>Does it mean VFP is not capable of comparing values from tables
>directly in the SQL-SELECT ?? Or what am I doing wrong ?
>Any ideas ?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only