Count deleted rows?

69 views
Skip to first unread message

Alan Carr

unread,
Mar 22, 2013, 11:42:06 AM3/22/13
to mapi...@googlegroups.com
Hi guys,

I am processing some survey tab files, any items that no longer exists, surveyors have deleted from the TAB file, is there a quick way to return the amount of blank rows (I haven't packed the table yet).

Thanks,
Alan

David Reid

unread,
Mar 22, 2013, 11:48:08 AM3/22/13
to mapi...@googlegroups.com
Open a browser of the table, make note of the total number of records it shows, then run an SQL query "Where:  obj" to count actual objects, subtract the later from the first will tell you how many records have been deleted from the Table
 
HTH
David Reid
 


From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Alan Carr
Sent: Friday, March 22, 2013 10:42 AM
To: mapi...@googlegroups.com
Subject: [MI-L] Count deleted rows?

--
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Thomas Bacon

unread,
Mar 22, 2013, 11:49:56 AM3/22/13
to mapi...@googlegroups.com

I didn’t think the count at the bottom of the browser window included deleted rows; does it?!

 

Tom Bacon

GIS Engineer, Mouchel

T 01444 472380 │ E thomas...@mouchel.com W www.mouchel.com

Our values: innovation │ excellence │ integrity │ responsibility



Mouchel logo

Mouchel Limited (Mouchel) is registered in England and Wales with registered number 01686040 at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX.  The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. No contracts may be concluded on behalf of Mouchel by means of email communications. Mouchel reserves the right to monitor and intercept emails sent and received on our network. 

Uffe Kousgaard

unread,
Mar 22, 2013, 11:55:03 AM3/22/13
to mapi...@googlegroups.com
It includes deleted and un-deleted records. Easy to try.

Regards
Uffe Kousgaard

Uffe Kousgaard

unread,
Mar 22, 2013, 11:58:42 AM3/22/13
to mapi...@googlegroups.com
[Edit]

It includes deleted and non-deleted records. Easy to try.


Regards
Uffe Kousgaard

Thomas Bacon wrote:

sidharth...@gmail.com

unread,
Mar 22, 2013, 1:29:26 PM3/22/13
to mapi...@googlegroups.com
Hi,
try this.
select count(*) from <tablename> where not obj

----------
Sent from my Nokia phone

------Original message------
From: Uffe Kousgaard <uffe.ko...@routeware.dk>
To: <mapi...@googlegroups.com>
Date: Friday, March 22, 2013 4:58:42 PM GMT+0100
Subject: Re: [MI-L] Count deleted rows?

[Edit]

It includes deleted and non-deleted records. Easy to try.

Regards
Uffe Kousgaard

Thomas Bacon wrote: I didn’t think the count at the bottom of the browser window included deleted rows; does it?!



Tom Bacon

GIS Engineer, Mouchel

T01444 472380│E thomas...@mouchel.com │W www.mouchel.com

Our values: innovation│ excellence│ integrity│ responsibility



Mouchel Limited (Mouchel) is registered in England and Wales with registered number 01686040 at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX.  The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. No contracts may be concluded on behalf of Mouchel by means ofemail communications. Mouchel reserves the right to monitor and intercept emails sent and received on our network.

Thomas Bacon

unread,
Mar 22, 2013, 1:32:02 PM3/22/13
to mapi...@googlegroups.com
Just so you know, this method would also pick up any records which haven't got map objects as "deleted".

Tom Bacon
GIS Engineer, Mouchel
T 01444 472380 │ E thomas...@mouchel.com │ W www.mouchel.com
Our values: innovation │ excellence │ integrity │ responsibility


David Reid

unread,
Mar 22, 2013, 1:33:53 PM3/22/13
to mapi...@googlegroups.com

This will only find records that do not have a map objects associated with
the data. Not a reliable means for determining deleted rows.

-Dave

Gentreau

unread,
Mar 22, 2013, 1:41:18 PM3/22/13
to mapi...@googlegroups.com
Surely any method which counts Objects carries the same risk.
What happens to RowId for deleted records, is it persisted, or not ?

Perhaps the most reliable way is to count the records, pack the table, then count them again, saving backup copies first of course.

Uffe Kousgaard

unread,
Mar 22, 2013, 1:59:33 PM3/22/13
to mapi...@googlegroups.com
Just do

select count(*) from <tablename>

Regards
Uffe Kousgaard

Warren Vick

unread,
Mar 22, 2013, 2:30:48 PM3/22/13
to mapi...@googlegroups.com

Hello Alan,

 

Lots of opinions and suggestions here, but I think there's only one reliable way. Take the number of rows reported (which includes the deleted rows) and subtract the count(*) from the table (which excludes the deleted rows).

 

If you simply open a browser window, you see the number of rows. In the MapBasic window, you can also use:

print tableinfo(TableName, 8)

 

Number 8 equates to TAB_INFO_NROWS, if you were writing a MapBasic program.

 

To count the actual number of records:

select count(*) from TableName

 

Then, get your calculator out...

 

Don't be distracted by whether a row has an object or not. That's not related to whether the row is deleted.

 

Regards,

Warren Vick

Europa Technologies Ltd.

http://www.europa.uk.com

 

From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Alan Carr
Sent: 22 March 2013 3:42 PM
To: mapi...@googlegroups.com
Subject: [MI-L] Count deleted rows?

 

Hi guys,

--

Alan Carr

unread,
Mar 27, 2013, 8:41:22 AM3/27/13
to mapi...@googlegroups.com
Sorry for the slow reply guys. Thank you!
Reply all
Reply to author
Forward
0 new messages