[GIS] Check if an object is empty in mapbasic

mapbasicmapinfosql

I have mapbasic code that manipulates the obj-column in a point-table. Some rows doesn't have any geometry so the obj-column is empty. My question is how to check if there is no object?

All the methods i found in the mapbasic-reference that givs information about the obj-column, like ObjectInfo(), try to access the object which givs an error since there is none.

Is there any way to use SQL to select the rows with non empty obj-columns?

Regards

Best Answer

  • Query For Selecting row(s) without object :
    Select * from 'MYTABLE' where not obj into MYTABLE_NO_MAP_OBJECT   
    Browse * From MYTABLE_NO_MAP_OBJECT
  • Query For Selecting row(s) with object :
     Select * from MYTABLE where obj into MYTABLE_MAP_OBJECT
     Browse * From MYTABLE_MAP_OBJECT