If there is a key field that relates these two tables together (like
Cust_Id in this example) , then use that with an SQL select and update
like this:
SELECT A.Phone_Nbr, B.Phone_Nbr "Nbr" FROM ILEC_ADDR A, Current_Trans B
WHERE A.Cust_Id = B.Cust_Id INTO tmp
UPDATE tmp SET Phone_Nbr = Nbr
COMMIT TABLE ILEC_ADDR
CLOSE TABLE tmp
You can put these commands right in your MapBasic program. What's going
on here is we assign short alias names ( A and B) to the two tables so
we can differentiate the field names that are spelled the same. We then
join the tables extracting the Phone_Nbr fields into a temporary table
named tmp. Then we update tmp setting the first column equal to the
values in the second column. Because these fields are in a temporary
table they are really still attached to their actual tables. Finally,
the COMMIT saves the changes and we close the tmp table.
If you don't have a key field to join these tables, then you really
ought to make one.
Your suggestion makes sense to me after I thought about it more.
Thanks Again
Tom
> Define Phone Current_Trans.Phone_nbrhas> Fetch first From
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bill is right.
The problem you are seeing is caused by you trying to update a column in one table with data from another table. And where there's no match, the value will be set to zero.
MapInfo Pro has worked like that for decades and whether that's right or not is a discussion we always can take :-)
There's however a more simple solution:
1. Join your two tables using SQL Select and only select the columns you really need for your update (just to make it easier):
Select areas.area "areas_area", areas.period "areas_period", _9_1.period "_9_1_period"
From areas, _9_1
Where areas.area = _9_1.area
Now you have a query where the rows have been linked where the areas are the same.
Next step is to update the column period from the table areas with the data from the table _9_1.
2. You can do this using the Update Column where you pick the query you got from the SQL Select above:
Update Query1
Set areas_period = "_9_1_period
Because you are updating a query, you'll see that the values written to this is stored in the base table the query is based upon.
Peter Horsbøll Møller
GIS/LI Presales Specialist
Location Intelligence | MapInfo
M: +45 29 133 769
peter....@pb.com | @phorsbollmoller
pitneybowes.com/dk | mapinfo.com
-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Bill Thoen
--
--
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.To post a message to this group, send email to mapi...@googlegroups.com To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching archives, feature requests, to visit our Wiki, visit the Welcome page at http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi
Change this line:
Update manager Set manager_expense = "client_expense" from Selection
To:
Update Selection Set manager_expense = client_expense
Peter Horsbøll Møller
GIS/LI Presales Specialist
Location Intelligence | MapInfo
M: +45 29 133 769
peter....@pb.com | @phorsbollmoller
pitneybowes.com/dk | mapinfo.com
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You can use Update column.
Table to Update: Pick the table
Column to Update: Pick the column you want the values to go into
Get Value from: leave it as the same table as the table to update
Value: write the name of the column to read the values from – or select it using the Assist button
Peter Horsbøll Møller
EMEA Channel Enablement Specialist
Location Intelligence | MapInfo
M: +45 29 133 769
peter....@pb.com | @phorsbollmoller
pitneybowes.com/dk | mapinfo.com
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
If Subcs.system_type = Survey.System Then
Add Column Subcs (area_1)
From Survey
Set To Total_Area
Where within
Else
End If
Which must mean that you might have a variable with the same name as a table or column mentioned above.
I’m assuming that the values marked in red all are hard coded table or column names. Is that correct?
Peter Horsbøll Møller
Pitney Bowes
From: 'RM' via MapInfo-L [mailto:mapi...@googlegroups.com]
Sent: 4. juli 2017 18:13
To: MapInfo-L <mapi...@googlegroups.com>
If Subcs_system_type = Survey.System Then