Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NOFILTER (Was Re: Rushmore Design Flaw...)
Message
From
10/07/1999 06:41:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
09/07/1999 20:04:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00239721
Message ID:
00239780
Views:
7
>I come from the Fox2.x world and have only recently begun work with VFP. The problem with NOFILTER came up here Monday and it took me 30 minutes to track down what was happening (which incidently, the help file on SELECT-SQL was what pointed me to NOFILTER). I noticed a few things during my investigation and was hoping people could enlighten me on the way NOFILTER works and SELECT's workings in VFP now (is there any other difference I should be aware of).
>
>Things I noticed:
>1) The filtered cursor only seemed to be created when the where clause had an indexed element and you were selecting all, eg:
>Select * from Table Where LogicalFld into Cursor Temp
>
>2) You could still use that filtered cursor in append commands, eg:
>Select Temp
>lcDBF = DBF()
>Select Table2
>Append from &lcDBF

>
>Thanks for the help.
Whenever you need a true cursor then use nofilter. In Fox2x true cursors were created either including nonexistant fields (ie: trim(first_name)+" "+trim(last_name) as name) or adding a dummy .t. to where clause (where eExpression and .t. or just where .t.). Now in VFP there is "nofilter" forcing it.
From a view point, a true cursor means no matter what the size is it would be created on disk. So if you don't have a need to index, edit, reSQL a cursor then do not use nofilter. With large tables it means noticeable time to create the new cursor on disk and if resultant cursor would include majority of records then it could mean you would need plenty of space too. Otherwise always use nofilter. :
select myFld1, dConfirmed, nAmount ;
   from myTable where dConfirmed = date() into cursor myCursor
scan
 if !seek(myCursor.myFld1,"anothertable","itstag")
    insert into anothertable (....) values (myCursor.myFld1,...)
 else
    replace anothertable.tAmount ;
         with anothertable.tAmount + myCursor.nAmount ;
         in "anothertable"
 endif
 ...
endscan
* This sample doesn't need access other than RO to myCursor, 
* so true cursor is not needed
* OTOH this needs a true cursor
* select .... where .t. into cursor myCursor && Fox2x nofilter
select .... into cursor myCursor nofilter
* do something
select ... from myCursor .... && reSQL from myCursor 
Another side note :
After creating a cursor if you get a handle to edit it, with pseudo cursors what you're editing is the table you selected from, but with true cursors you'd be editing a temp table (yeah true cursors are tables that fox does cleanup for you unless you get the handle to edit) that you could throw afterwards.
select ... from myTable into cursor myCursor
? dbf("myCursor") && ...\myTable.dbf
select ... from myTable into cursor crsCursor nofilter
? dbf("crsCursor") && ...\....tmp
Do not let file(...tmp) returning .f. or not seeing it in explorer mislead you think it's not created on disk :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform