Article ID: 176884
Article Last Modified on 3/14/2005
CREATE CURSOR t1 (in1 i)
INDEX ON in1 TAG in1
CREATE CURSOR t2 (in2 i)
INDEX ON in2 TAG in2
SELECT * FROM t1 LEFT JOIN t2 ON t1.in1=t2.in2 INTO CURSOR t3
SELECT * FROM t1 RIGHT JOIN t2 ON t1.in1=t2.in2 INTO CURSOR t3
Either statement above can replace the following line in the sample
program below:
SELECT * FROM t1,t2 WHERE in1=in2 INTO CURSOR t3
CLEAR ALL
CLEAR
** Store the current collation sequence to the variable yyy.
yyy=SET("collate")
** Setting collate to General, a collation sequence that illustrates
** the problem.
SET COLLATE TO "General"
** Create two cursors with one integer field in each
CREATE CURSOR t1 (in1 i)
CREATE CURSOR t2 (in2 i)
** Populate each cursor with 1000 records, inserting the loop counter
** into the integer field.
FOR x=1 TO 1000
INSERT INTO t1 (in1) VALUES(x)
INSERT INTO t2 (in2) VALUES(x)
ENDFOR
** The SELECT statement to join the two tables.
SELECT * FROM t1,t2 WHERE in1=in2 INTO CURSOR t3
** Checking _Tally to see how many records the query returned.
WAIT WINDOW STR(_Tally)+" records returned by the query"
** Start of loop to determine what records are missing.
x=0
SCAN
x=x+1
IF NOT in1=x
WAIT WINDOW "Missing integer"+ STR(x)
x=in1
ENDIF
ENDSCAN
** Set collate back to its original setting
SET COLLATE TO yyy
Collation Sequence Platform Missing Records
------------------ -------- ---------------
Dutch, General
German, Iceland
Nordan, Spanish
Swefin Windows 17, 273, 529, 785
Uniqwt Windows, Mac 46, 302, 558, 814
Dutch, General
German
Nordan, Spanish
Swefin Mac 24, 280, 536, 792
Czech, General
Hungary, Polish Eastern European
Windows, MS-DOS 22, 278, 534, 790, 1046
Slovak Eastern European
MS-DOS 21, 277, 533, 789, 1045
Slovak Eastern European
Windows 23, 279, 535, 791, 1047
Czech, General
Slovak Kamenicky (Czech)
MS-DOS 19, 275, 531, 787, 1043
General, Iceland Icelandic MS-DOS 19, 275, 531, 787, 1043
Greek Greek MS-DOS 19, 275, 531, 787, 1043
Greek Greek Windows 23, 279, 535, 791, 1047
Russian Russian MS-DOS 19, 275, 531, 787, 1043
Russian Russian Windows 22, 278, 534, 787, 1043
Polish Mazovia (Polish)
MS-DOS 17, 273, 529, 785, 1041
NOTE: The Iceland collation sequence is not available in Visual FoxPro
for the Macintosh.164869 SET COLLATE TO "GENERAL" May Affect Search Results
Additional query words: SQL select collate
Keywords: kbbug kbpending KB176884