Discussion:
Empty Table
(too old to reply)
Marc
2008-06-26 04:20:32 UTC
Permalink
Hi
Is there any property to check a table is empty
Stefan Wuebbe
2008-06-26 05:06:35 UTC
Permalink
Post by Marc
Hi
Is there any property to check a table is empty
Depends on how you define "empty table".
RecCount() does not care for deleted rows so if that matters,
you can Set Deleted On/Off and Select Count(*) From ...
If an alias is buffered, you can add an " (With Buffering=.T.) ".
See also "Count" in help.


hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Rush Strong
2008-06-26 13:31:04 UTC
Permalink
Post by Marc
Hi
Is there any property to check a table is empty
As Stefan posted, a truly empty table (no records at all, deleted or
not) will have RECCOUNT() = 0. Another way to see if there are no
non-deleted records is:

GO BOTTOM
lEmpty = BOF()

- Rush

Loading...