wqbyangtzeu / spatialite-android

Automatically exported from code.google.com/p/spatialite-android
0 stars 1 forks source link

Running an Insert Query causes a crash #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Creat a spatial table in a spatialite database with the following definition :

CREATE TABLE AssetInfo("PK_UID" INTEGER PRIMARY KEY AUTOINCREMENT, AssetId 
varchar(25),ProjectId varchar(40),"Geometry" POINT);

Use the following code in your Android Application to insert a new row:

String query="Insert into AssetInfo (AssetId, ProjectId, Geometry) 
values('A00234', 'JK0123', GeomFromText('POINT(12.23 77.51)' , 4326));";

db = new jsqlite.Database();
db.open(SpatialDBFile.getAbsolutePath(), 
jsqlite.Constants.SQLITE_OPEN_READWRITE| jsqlite.Constants.SQLITE_OPEN_CREATE);

Stmt cmd=db.prepare(query);
cmd.step();

What is the expected output? What do you see instead?

The query should run, and insert a new row. Instead this throws the following 
error:  jsqlite.Exception: SQL logic error or missing database

The same query works fine on the same database in Spatialite_gui. 

What version of the product are you using? On what operating system?
Android 4.0.4

Original issue reported on code.google.com by dev...@gmail.com on 30 Jan 2014 at 3:50