Hi Robert,
Your query should at least read :
update dbo.T_FTPSITE_RAWDATA_MKYMTDATA
set sw_geometry = 'ST_POINT(' + longitude + ',' + latitute + ')'
and maybe even
update dbo.T_FTPSITE_RAWDATA_MKYMTDATA
set sw_geometry = 'ST_POINT(' + CAST(longitude as varchar(25)) + ',' +
CAST(latitute as varchar(25)) + ')'
The textual representation given to sw_geometry is parsed and executed (by a
trigger), but it doesn't allow for variable
substitutions, so you need to extract and format the values. Did you remember
to spatialize the table with "exec
sp_sw_spatialize_column ..." first ?
If you run the statement via a MapBasic program the command is as follows:
hStmt = Server_Execute (hDBc,
"update dbo.T_FTPSITE_RAWDATA_MKYMTDATA set sw_geometry = 'ST_POINT('
+ CAST(longitude as varchar(25)) + ',' +
CAST(latitute as varchar(25)) + ')'"
)
i.e. just as it's stated above, just enclosed in MapBasic text apostrophes. A
command in a command if you will.
You can use a stored procedure if you want, but the syntax of the update is the
same.
Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/
----- Original Message -----
From: "Robert Crossley" <[EMAIL PROTECTED]>
To: "MapInfo List" <[email protected]>
Sent: Friday, June 03, 2005 3:23 AM
Subject: MI-L creating points in spatial ware
Hi all,
I have a csv table of data that includes x and y coordinate coordinates
that I want to insert into a spatialware sql server database. That part
is easy enough, but I want to then create the points on the server side.
This is the first time that I am trying to do object creation and
manipulation on the server through spatialware - normally all of this is
done through MI Pro.
I have inserted the data into the table on the server that has been
created with easyloader (and then had the data deleted), and I get the
records in OK. I am using an ado recordset, and on the program side I add
all the data to the recordset and the do an update. THis doesn't allow me
to create the spatial points as I add them to the recordset.
I thought I would then update the table with a command like this
update dbo.T_FTPSITE_RAWDATA_MKYMTDATA set sw_geometry =
'ST_POINT(longitude,latitute)'
where longitude and latitude are the fields that have the data for x and y
coordinates expressed in the projection of that table.
It seems to run OK, but then when i open the table up in MapInfo, there
are no objects in the table.
I am concerned that the field references won't carry through to the
procedure.
Is this syntax right, or should I use a stored procedure?
Help,
thanks r
--
________________________________________________
Robert Crossley
Agtrix P/L
9 Short St
PO Box 63
New Brighton 2483
Far Southern Queensland
AUSTRALIA
153.549004 E 28.517344 S
P: 02 6680 1309
F: 02 6680 5214
M: 0419 718 642
E: [EMAIL PROTECTED]
W: www.agtrix.com
W: www.wotzhere.com
skype: robertcrossley
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16653
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16668