Re: VFP and understanding 'repackaged cursors'
- From: Cy Welch <cywelch@xxxxxxxxx>
- Date: Thu, 08 Feb 2007 16:41:29 -0800
Jim Czeb wrote:
We just ran into an issue with selecting * from a table using one ofHaving looked and seeing that it appears nobody was able to answer I actually do have an answer for you.
the indicies in the where clause and receiving back a 'filtered view'
or 'repackaged cursor' of the table and not a real cursor.
You can not do a subquery on the cursor and a reccount() of the cursor
returns the number of records in the original table. (_tally reports
correctly).
Upon looking in the help we discovered that you must either use a
readwrite clause or a nofilter clause to force the cursor to be
written to disk.
The help also said that if you select using a field list and not *
this won't happen.
In our playing around with this we have been getting inconsistent
results which raises concerns that the behavior will not produced
expected results every time. Another concern is that if existing code
is modified so that all columns are desired where a field list was
previously used that existing code could break.
Adding nofilter could be done but we have a large number of queries in
code.
Does anyone out there have any more experience with this??
Jim Czeb
Any time you create a query of a single table that is able to be displayed using a filter rather than actually creating a cursor, VFP actually just sets up the alias with a filter on it. If you include just a single field that is calculated (such as concenating (SP) two fields or such) then it must create a real cursor. Also using the NOFILTER clause will perform the same thing. Basically if you could have browsed the same list by setting a filter and browsing, that is exactly what VFP will do without either of the two clauses you have named.
I hope this helps,
--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com
.
- Follow-Ups:
- Re: VFP and understanding 'repackaged cursors'
- From: Jim Czeb
- Re: VFP and understanding 'repackaged cursors'
- References:
- VFP and understanding 'repackaged cursors'
- From: Jim Czeb
- VFP and understanding 'repackaged cursors'
- Prev by Date: Re: Program on a flash Drive
- Next by Date: Re: Program on a flash Drive
- Previous by thread: Re: VFP and understanding 'repackaged cursors'
- Next by thread: Re: VFP and understanding 'repackaged cursors'
- Index(es):
Relevant Pages
|