Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SELECT and code pages problem
Message
From
26/07/2001 17:36:26
 
 
To
25/07/2001 23:50:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00535512
Message ID:
00536054
Views:
9
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
Map
View

Click here to load this message in the networking platform