I use Firefox plugin SQLite Manager execute my SQL:
declare @id int
declare @lon float
declare @lat float
set @id=5
set @lon=118.476000
set @lat=32.033720
while @i<=10000
begin
INSERT INTO njdm
(ID,dalei,xiaolei,hanyi,level,longitude,latitude)
VALUES
(@id, 5, 10, "地名描述",1,@lon,@lat)
set @id=@id+1
set @lon=@lon+0.000010
set @lat=@lat+0.000010
end
And get the error:
[ near "declare": syntax error ]
Exception Name: NS_ERROR_FAILURE
Exception Message: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [mozIStorageConnection.createStatement]
any help?TIA!
SQLite supports only SQL operations, it does not directly support variables, variable assignments, looping, or other program constructs. You will need to write this code in some other language that supports those constructs, then send the commands to SQLite either by constructing dynamic SQL or by using one of the SQLite support libraries associated with your selected language.