Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I check for the number if recods in a table?
Message
From
06/11/1997 11:53:30
 
 
To
05/11/1997 20:05:18
Shihchau Tai
Apic Systems Pte Ltd
Singapore, Singapore
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00058136
Message ID:
00058623
Views:
34
>>>>>>>>>>I want the count of the table to return empty even if it has
>>>>>>>>>>records mark as deleted. reccount() ignores set dele on.
>>>>>>>>>>any ideas?
>>>>>>>>>
>>>>>>>>>How about COUNT FOR NOT DELETED() TO lnRecCount?
>>>>>>>>
>>>>>>>>COUNT will move the cursor to the end of the table.
>>>>>>>>If you don't want he cursor to move, you could use also:
>>>>>>>>
>>>>>>>>SELECT Count(*) FROM MyTable WHERE Deleted() = .F.
>>>>>>>
>>>>>>>Take note that SELECT will not work for tables on table-buffering mode.
>>>>>>
>>>>>>True, but you can set buffering off, SELECT, then on again...
>>>>>
>>>>>You are not saying the records in the buffer can be SELECTed, right? I will be very happy if I can get all the records, including those in the buffer, using SELECT statement. I have been using commands like COPY TO before SELECT in order to get those records in the buffer.
>>>>
>>>>CURSORSETPROP('buffering',1,'mytable')
>>>>SELECT blah blah blah
>>>>CURSORSETPROP('buffering',5,'mytable')
>>>
>>>Will the buffered records get written back to disk this way? I thought SELECT always gets data from disk. It wouln't get data from memory.
>>>
>>>I am confused. Can you elaborate?
>>
>>Is there a reason that you don't want to commit changes before doing a count?
>
>Because it is part of a transaction. The user has a choice of reverting the all the changes he has made during the transaction.

Ahhh-
Then my suggestion wouldn't be very helpful. I believe your right about select...
I'm still not sure what you need to get done though...
if you need a count of records in a buffered table without committing changes in the buffer, you might need to implement something like like save the record position and scatter memvar before doing the count, and then you have the memory variables in case you want to revert with gather memvar.

I hope my suggestions are coherent considering that I don't really know what you are trying to do.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform