Knowledge Base

SELECT - SQL's NOFILTER Clause Forces Physical File

Article ID: 155928

Article Last Modified on 10/15/2003


APPLIES TO


This article was previously published under Q155928

SUMMARY

The new SELECT ... INTO CURSOR ... NOFILTER clause causes a cursor to be created that has a corresponding physical file.

MORE INFORMATION

In previous versions of FoxPro, the following code generates an error:
   SELECT * FROM customer INTO Cursor temp
   SELECT * FROM temp INTO Cursor temp2
				
The following error, 1815, is generated:
'TEMP' must be created with SELECT...INTO TABLE.
The following code was frequently used as a workaround in previous versions of FoxPro:
   SELECT *,.T. FROM customer INTO Cursor temp
   SELECT * FROM temp INTO Cursor temp2
				
The extra column created by the .T. causes a physical file to be created, which can have subsequent SELECT - SQL statements run against it.

In FoxPro 5.0, you can use the following code instead:
   SELECT * FROM customer INTO Cursor temp NOFILTER
   SELECT * FROM temp INTO Cursor temp2
				
The NOFILTER clause forces the SELECT to create a physical file that can have SELECT - SQL statements run against it, without adding more columns.

When the cursor is closed, the physical (temp) file is deleted.

Keywords: kbinfo kbsqlprog kbdatabase KB155928