Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
  • Query For Selecting row(s) without object :
    Select * from 'MYTABLE' where not obj into 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
share|improve this answer

Alternative if you loop a table in MapBasic code:

dim a as alias
dim o as object
dim t as string

t = "MyTable"
a = t + ".obj"

fetch first from t
do while not EOT (t)
  if a then 
    o = a
    ' Do something with o
  end if
  fetch next from t
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.