Help me understand this...
Posted: 23.03.2006, 20:56
I'm testing the spatial possibilties in MySQL. For this purpose I have defined a table as follows:
.................................................................................................
CREATE TABLE `myspatial` (
`ETYPE` varchar(15) default NULL,
`LAYER` varchar(100) default NULL,
`COLOR` int(11) default NULL,
`LINETYPE` varchar(100) default NULL,
`LTSCALE` double default NULL,
`THICKNESS` double default NULL,
`geom` geometry default NULL,
`H` geometry default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
................................................................................................
The following code fragment shows how I try to populate the table with data.
;...................................................................................................
with Form1 do
begin
ZQuery1.SQL.Clear;
ZQuery1.Close;
with ZQuery1.SQL do
begin
add('insert into MySpatial (EType, Layer, Color, LineType, LTScale, Thickness, geom) values (');
add(IntToStr(NN.EntityType));
add(', ' + NN.Layer);
add(', ' + IntToStr(NN.Color));
//add(', ' + NN.LineType);
add(', ' + '141');
add(', ' + FloatToStr(NN.LineTypeScale));
add(', ' + FloatToStr(NN.Thickness));
add(', ' + 'GeomFromText' + strKoordList + ')');
//add(')');
end;
ZQuery1.ExecSQL;
end;
.............................................................................................
if the values for LAYER and LINETYPE consists of strings with only numbers
the table will be updated, but if there is also letters the call will fail.
Using SQLYOG I can give these fields also alfanumeric values.
Is this a bug in ZEOS??
I'm using ZeosDBO 6.5.1-alpha CVS release as of 13/10/2005 and
MySQL 5.1
//Alf
.................................................................................................
CREATE TABLE `myspatial` (
`ETYPE` varchar(15) default NULL,
`LAYER` varchar(100) default NULL,
`COLOR` int(11) default NULL,
`LINETYPE` varchar(100) default NULL,
`LTSCALE` double default NULL,
`THICKNESS` double default NULL,
`geom` geometry default NULL,
`H` geometry default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
................................................................................................
The following code fragment shows how I try to populate the table with data.
;...................................................................................................
with Form1 do
begin
ZQuery1.SQL.Clear;
ZQuery1.Close;
with ZQuery1.SQL do
begin
add('insert into MySpatial (EType, Layer, Color, LineType, LTScale, Thickness, geom) values (');
add(IntToStr(NN.EntityType));
add(', ' + NN.Layer);
add(', ' + IntToStr(NN.Color));
//add(', ' + NN.LineType);
add(', ' + '141');
add(', ' + FloatToStr(NN.LineTypeScale));
add(', ' + FloatToStr(NN.Thickness));
add(', ' + 'GeomFromText' + strKoordList + ')');
//add(')');
end;
ZQuery1.ExecSQL;
end;
.............................................................................................
if the values for LAYER and LINETYPE consists of strings with only numbers
the table will be updated, but if there is also letters the call will fail.
Using SQLYOG I can give these fields also alfanumeric values.
Is this a bug in ZEOS??
I'm using ZeosDBO 6.5.1-alpha CVS release as of 13/10/2005 and
MySQL 5.1
//Alf