Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why reccount() and _tally are different ?
Message
From
09/05/1998 08:45:00
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00097511
Message ID:
00098279
Views:
66
Jim,

*Hopefully*, this will be my last words on this subject. . .

Francois was originally asking WHY the results were different. Several people had already told him the difference regarding RECCOUNT()/TALLY when I (finally) wrote.

It seemed obvious to me (and I believe this was confirmed by his later response) that he was being confused by the . . .INTO CURSOR. . . clause and the fact he was NOT *actually* getting a cursor.

So I clarified that one doesn't always get a cursor with this type of query. I told him to use NOFILTER and see if that would change his result, It should, of course, but Barbara P. has previously reported that she did not get a cursor every time with the NOFILTER clause coded, so there seems to be undocumented or unknown conditions where it will not happen regardless.

In other words. . . I know (and knew) the definitions for RECCOUNT() and TALLY, but they were NOT the issue. Those were raised by David because he doesn't tolerate the fact that I often offer opinions along with my answers - opinions which sometimes criticize VFP. So he saw an opportunity to be-little.
He started out with TABLE !=CURSOR. Smart, but that was not what I had said!
I had said that they were FOR ALL INTENTS AND PURPOSES ('to this discussion' being implied) equivalent, and I based this on the following:
. . . from CREAATE CURSOR: ". . . A temporary table created with CREATE CURSOR can be manipulated like any other table. . ." and, from Select-SQL: ". . . After Select has executed, the temporary cursor remains open but is read-only".

Since it appeared that David really needed to vent, I elected not to respond, though he was incorrect elsewise too.

Cheers,
Jim N

>Jim,
>
>Just to add to the discussion, from the help file for RECCOUNT()
>
>"Returns the number of records in the current or specified table."
>
>"Remarks
>
>The value RECCOUNT( ) returns isn’t affected by SET DELETED and SET FILTER."
>
>and now _TALLY
>
>"Contains the number of records processed by the most recently executed table command."
>
>"Certain table processing commands return information about their status (“talk”) while they execute. When such a command finishes executing, it displays the number of records it processed (if SET TALK is ON), and stores this number to the _TALLY system variable.
>
>The following commands return status information:
>
>APPEND FROM AVERAGE
>CALCULATE COPY To
>COUNT DELETE
>INDEX PACK
>REINDEX REPLACE
>SELECT - SQL SORT
>SUM TOTAL
>UPDATE
>
>When you start Visual FoxPro, _TALLY is set to 0. Executing one of the commands above replaces the _TALLY value with the number of records the command processed."
>
>These two definitions seem pretty clear to me. The unclear part of all of this has nothing to do with these two functions (actually one function and one variable) it has to do with the fact that an SQL SELECT may be optimized by using the table again in another work area under another alias and setting a filter on it. In that case _tally tells us the number of records which meet the filter condition and reccount() tells us the number of records in the table.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform