MapInfo Professional and Select All Object Types in a SQL Query

UPDATED: April 3, 2017

How to select all objects of a certain type? For example, how to select all the "line" objects in a table?

Choose Query>SQL Select. Specify the table name in the From Tables box. Click in the Where Condition box. Click on the Functions button. Choose the STR$() function. Within the parentheses, type in obj. Outside of the parentheses, type the equal sign. In quotes, put the object type to be selected. 

For example:

Where Condition: Str$(obj)="Line"

Any of the following object types may be used in the query:

"Point", "Multipoint", "Line", "Polyline", "Region", "Collection", "Rectangle", "Rounded Rectangle", "Arc", "Ellipse", or "Text".

Note: Str$(obj) will return a null string [ "" ] if there is no object associated with a row. To select all rows in a table that have no associated map object (for example, all ungeocoded rows after a geocoding operation) use the where Condition: Str$(obj)="".

Select * where not obj is another method and is probably faster than a string comparison to find an empty string.



  • No Downloads