Bookmark this page: Add SQL UPDATE using 2 tables in MapInfo 8 to Yahoo MyWeb Add SQL UPDATE using 2 tables in MapInfo 8 to Google Bookmarks Add SQL UPDATE using 2 tables in MapInfo 8 to Windows Live Add SQL UPDATE using 2 tables in MapInfo 8 to Del.icio.us Digg SQL UPDATE using 2 tables in MapInfo 8! Add SQL UPDATE using 2 tables in MapInfo 8 to Netscape
  •  
  • Subject
  • Author
  • Date
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by Christian Peter Aaberg on April 29, 2006, 7:59 am
Hi,

I was wondering, if anyone know if it is possible to update a column in a
table, using data data from two tables in the update. I am trying to do
exactly that, but does not seem to work in anyway. The query menu only give
an "SQL Select" option and and the table menuen only "update column". In
"update column" it is only possible using one table. But it is really
primitive that I have to add two extra rows to one of my tables that does
not have to be there, for making a calculation, when finished I delete the
two rows again. The update that I want to have working is: "UPDATE
restaurant, centrum SET restaurant.distance = restaurant.x_row -
centrum.x_row" and this does not work. Any suggestions???

AA



Posted by B.Feldman on May 5, 2006, 4:59 pm
Hi,
I'm not very good in English. And may be I'm not understand your task and
question. But I can't see how U join two tables.
And now, for MapInfo, if U want to update more then one column U need to
create a SQL-string for Mapinfo and run it in Mapbasic window of Mapinfo.
The rights of SQL for MapInfo are described in MapBasic manual (or tutorial)
that is on any legal Mapinfo's instalation CD or some variant U can find on
mapinfo's web page.
{ text from MapBasic's 7.0 Help
Update table Set column = expr [, column = expr, ...]
[ Where RowID = idnum ]
}.
If U only needs to update column in tableA by values from tableB, U are to
do thouse steps:
1. create a query based on tableA with some (or all) the columns from
tableB: Select * from tableA,tableB where (describe how they are joined)
into queryC
2. update queryC set col1=(define your values)
It will work.
Best regards,
Boris Feldman,
Moscow,Russia

> Hi,
> I was wondering, if anyone know if it is possible to update a column in a
> table, using data data from two tables in the update. I am trying to do
> exactly that, but does not seem to work in anyway. The query menu only
> give
> an "SQL Select" option and and the table menuen only "update column". In
> "update column" it is only possible using one table. But it is really
> primitive that I have to add two extra rows to one of my tables that does
> not have to be there, for making a calculation, when finished I delete the
> two rows again. The update that I want to have working is: "UPDATE
> restaurant, centrum SET restaurant.distance = restaurant.x_row -
> centrum.x_row" and this does not work. Any suggestions???
> AA
>