TableInfo command to detect if a table has deleted rows?

64 views
Skip to first unread message

Nicholas G Lawrence

unread,
Jun 10, 2021, 8:19:06 PM6/10/21
to mapi...@googlegroups.com

Hi all,

 

Can I use TableInfo to detect if a table has deleted rows that could be packed?

That is, the rows were deleted and the table is saved, but you can still see the deleted rows in the browser.

TableInfo(<table>, TAB_INFO_EDITED) is not what I’m looking for, I think.

 

Nick Lawrence
Senior Spatial Science Officer | Geospatial Technologies
Engineering & Technology | Transport and Main Roads

 

Floor 19 | 313 Adelaide Street | Brisbane City Qld 4000
GPO Box 1412 | Brisbane City Qld 4001
P: (07) 30667977
E: nicholas....@tmr.qld.gov.au
W:
www.tmr.qld.gov.au

 

***********************************************************************
WARNING: This email (including any attachments) may contain legally
privileged, confidential or private information and may be protected by
copyright. You may only use it if you are the person(s) it was
intended to be sent to and if you use it in an authorised way. No one
is allowed to use, review, alter, transmit, disclose, distribute, print
or copy this email without appropriate authority.

If this email was not intended for you and was sent to you by mistake,
please telephone or email me immediately, destroy any hardcopies of
this email and delete it and any copies of it from your computer
system. Any right which the sender may have under copyright law, and
any legal privilege and confidentiality attached to this email is not
waived or destroyed by that mistake.

It is your responsibility to ensure that this email does not contain
and is not affected by computer viruses, defects or interference by
third parties or replication problems (including incompatibility with
your computer system).

Opinions contained in this email do not necessarily reflect the
opinions of the Department of Transport and Main Roads,
or endorsed organisations utilising the same infrastructure.
***********************************************************************

Nicholas G Lawrence

unread,
Jun 10, 2021, 10:09:53 PM6/10/21
to mapi...@googlegroups.com

I note that TableInfo(<table>,TAB_INFO_NROWS) counts all rows including rows that have been deleted but not purged.

Is there a way of counting the number of rows that are not deleted?

--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/SY4P282MB154662A63524F8A435EBD347D3349%40SY4P282MB1546.AUSP282.PROD.OUTLOOK.COM.

Uffe Kousgaard

unread,
Jun 14, 2021, 5:40:55 AM6/14/21
to mapi...@googlegroups.com
Hi,

You can do "select * from <table> into tmp1 noselect" and then run TableInfo(...) on tmp1.

Regards
Uffe Kousgaard

Nicholas G Lawrence

unread,
Jun 14, 2021, 7:43:41 PM6/14/21
to mapi...@googlegroups.com

Yes, that’s what I am doing.

It just takes ages, I was hoping for something faster

Andrew N

unread,
Jun 15, 2021, 1:20:17 AM6/15/21
to MapInfo-L
Hi Nick

See attached, might be useful to you. I have been using this since 2008 to check if a table needs packing. Its pretty fast on a table with 50,000+ records, took about 5 secs to find 19 deleted records and pack the table.

Regards
Andrew
Pack_Table.txt

Andy Harfoot

unread,
Jun 21, 2021, 4:31:49 AM6/21/21
to mapi...@googlegroups.com

You can try comparing the result of

SELECT COUNT(*) FROM <table> INTO tmp1 NOSELECT

With the value returned by

TableInfo(<table>,TAB_INFO_NROWS)

They appear to differ for an unpacked table, the latter including deleted but not packed rows, I've not confirmed this beyond some test data though.

Cheers,

Andy

On 15/06/2021 00:43, 'Nicholas G Lawrence' via MapInfo-L wrote:
CAUTION: This e-mail originated outside the University of Southampton.
-- 
Andy Harfoot

Skype: gdi_ajph
Teams: aj...@soton.ac.uk

GeoData Institute
University of Southampton
Southampton
SO17 1BJ

www.geodata.soton.ac.uk
Reply all
Reply to author
Forward
0 new messages