Re: VFP and understanding 'repackaged cursors'

Tech-Archive recommends: Speed Up your PC by fixing your registry



Jim Czeb wrote:
We just ran into an issue with selecting * from a table using one of
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

Having looked and seeing that it appears nobody was able to answer I actually do have an answer for you.

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
.



Relevant Pages

  • Best practice question: Updating Aggregates
    ... Write a summary cursor which does the "group by" in the SQL ... Cons: Possible data integrity issues - what if the WHERE clause on the ... Aggregation occurs at 2 levels, plus several aggregate columns ...
    (comp.databases.oracle.misc)
  • Re: VFP and understanding repackaged cursors
    ... the indicies in the where clause and receiving back a 'filtered view' ... or 'repackaged cursor' of the table and not a real cursor. ... readwrite clause or a nofilter clause to force the cursor to be ... anything but a bare * results in no filter. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Oracle cursor help
    ... and a "where current of" clause to delete the row you are iterating over the cursor. ... Mail Mobile ... Take Yahoo! ...
    (perl.dbi.users)
  • Re: VFP and understanding repackaged cursors
    ... and add a NOFILTER or READWRITE from there. ... the indicies in the where clause and receiving back a 'filtered view' ... or 'repackaged cursor' of the table and not a real cursor. ...
    (microsoft.public.fox.programmer.exchange)
  • VFP and understanding repackaged cursors
    ... the indicies in the where clause and receiving back a 'filtered view' ... or 'repackaged cursor' of the table and not a real cursor. ... readwrite clause or a nofilter clause to force the cursor to be ...
    (microsoft.public.fox.programmer.exchange)