sancarn / Extended_MapBasic

This is an Open Source project. We are developing a powerful extension for the MapBasic Window in Pitney Bowes' MapInfo. The extension will give users the ability to compile on demand from the MapBasic Window. Further extensions may include custom MapBasic functions to accomplish common tasks. This project is still very much WIP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Idea] Table.ColumnName in SQL Select

sancarn opened this issue · comments

Something that annoys me a fair amount is when I am trying to loop over one table and select records in the other. For instance:

For i =1 to tableinfo(MyLookup,8)
  fetch rec n from MyLookupTable
  select * from MyTable where Lookup = MyLookupTable.Lookup into Q
  '... Do something with Q ...
  close Q
next

In my mind this should work in exactly the same way as the following:

Dim s as string
For i =1 to tableinfo(MyLookup,8)
  fetch rec n from MyLookupTable
  s = MyLookupTable.Lookup
  select * from MyTable where Lookup = s into Q
  '... Do something with Q ...
  close Q
next

However instead it simply errors out. I believe that this should be fixed in the MapBasic language and Should be, therefore, fixed in EMB.