Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you compare dates
Message
From
04/03/2010 14:33:59
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01452456
Message ID:
01452587
Views:
34
>>ohh i see hmm. Didnt kno that...i normally tested reccount() by sayin if REccount()=0 that kinda way
>>but thanks 4 clearing up the syntax guess its still safe to use as long as i use nofilter
>
>I am a stickler for details and here are the details for the two options being discussed.
>
>_TALLY is a system variable that exists to hold the count of records that resulted from the last SELECT statement that was executed. RECCOUNT() is a function that returns the physical number of records in a dbf table regardless of any filter or deleted status of those records, it is the physical count of records. When you want to know the physical count of records in a dbf use RECCOUNT(), when you want to know how many records are in the result set from a SQL SELECT statement then use _TALLY. Using RECCOUNT() to determine how many records were in the result of a SELECT statement is a misuse of the function, that is NOT what RECCOUNT() tells you.
>
>You will have a lot less tricky situations if you use the functions and system variables for what they are meant instead of depending on some side effect that they might (or might not) tell you. Don't work against the fox, work with it, life will be easier.

Hi Jim,

not to be picky, but _TALLY also reports other things. For instance the number of processed records in a SQL update command. I use it all the time, like this
Updata mytable set myfield=somevalue where PKfield=someothervalue
if _tally=0 && No such record, so I must create a new
   insert into mytable (PKfield,myfield) values (someothervalue,somevalue)
endif
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform