Professional Documents
Culture Documents
MapBasic Fundamentals
Update table
Set column = expr [ , column = expr, ...]
[ Where RowID = idnum ]
Use the dialog to get the syntax for one column and then
modify the statement to update several afterwards
Dataset
Exercise_Data\CriminalActivity.TAB
With Append Rows to Table you can insert records from one
table into another table
Using the dialog you can however not control which column is
inserted into which column.
When using the dialog the order of the columns is important
You can get around this issue using the MapBasic window
Using columnlist you can specify columns with names like ID,
X, Y, NAME instead of COL1, COL2, COL2, COL4
MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
Exercise
Dataset
US\CITY_125.TAB
US\STATECAP.TAB
Modify your script to have the style of the state capitals as red circles
using the statement:
Set Style Symbol(35,16711680,12,"MapInfo Symbols",0,0)
And the style of the cities as grey circles using this statement:
Set Style Symbol (35,8421504,8,"MapInfo Symbols",0,0)
Dataset
US\States.TAB
US\US_HIWAY.TAB
US\USCities.TAB (the table that we created in a previous exercise)
Set the size to (POP_1990 / 20000) miles or pick your own size
Set the style as blue border for cities and red for state capitals
Dataset
US\States.TAB
US\US_HIWAY.TAB
US\USCities.TAB (the table that we created in a previous exercise)
Add four columns (X1, Y1, X2, Y2) of type Float to the table USCities
Update these with:
CentroidX(Offset(OBJ, 45, (POP_1990 / 20000), mi))
CentroidY(Offset(OBJ, 45, (POP_1990 / 20000), mi))
CentroidX(Offset(OBJ, 225, (POP_1990 / 20000), mi))
CentroidY(Offset(OBJ, 225, (POP_1990 / 20000), mi))
Update CriminalActivity
Set X = CentroidX(obj)
, Y = CentroidY(obj)
, CrimeID = ROWID
Update USCities
Set OBJ = CreateLine(X1, Y1, X2, Y2)
Update USCities
Set OBJ = MBR(OBJ)
MapInfo User Conference 2014: GIS Gets Personal #MapInfoUC
Get the latest
MapInfo User Conference news:
Twitter via #MapInfoUC
and follow us @MapInfo