no such function: GeometryConstraints

1,497 views
Skip to first unread message

Olof

unread,
May 12, 2014, 11:24:32 AM5/12/14
to spatiali...@googlegroups.com
Hi
 
I'm new to SpatiaLite, so bear with me if my question(s) is stupid.
 
I use the SQLite and SpatiaLite C API to set up a database.
As far as I can tell, everything goes well creating the database, but when I am about insert data something is wrong.
 
When I call the function sqlite3_prepare_v2() I get an error, and sqlite3_errmsg(db) says: "no such function: GeometryConstraints"
 
What might cause this? Is it version related?
 
I'm using SQLite 3.6.22 and SpatiaLite 4.1.1 (and GEOS 3.3.8 if that's important). Will this cause any problems?
 
Any hints or similar experiences that you have solved?
 
Thanks in advance.
 
/Olof
 
 
 

a.fu...@lqt.it

unread,
May 12, 2014, 11:41:04 AM5/12/14
to spatiali...@googlegroups.com
On Mon, 12 May 2014 08:24:32 -0700 (PDT), Olof wrote:
> Hi
>
> I'm new to SpatiaLite, so bear with me if my question(s) is stupid.
>
> I use the SQLite and SpatiaLite C API to set up a database.
> As far as I can tell, everything goes well creating the database, but
> when I am about insert data something is wrong.
>
> When I call the function sqlite3_prepare_v2() I get an error, and
> sqlite3_errmsg(db) says: "no such function: GeometryConstraints"
>

Hi Olof,

this seems a clear sympthom that no SpatiaLite extensions has been
succesfully loaded and properly registered by SQLite; and consequently
no SQL function requiring SpatiaLite is then available.

counter-check: test some other SQL function requiring the SpatiaLite
extension support: e.g.
SELECT spatialite_version();
or
SELECT geos_version(),


> What might cause this? Is it version related?
>
> I'm using SQLite 3.6.22 and SpatiaLite 4.1.1 (and GEOS 3.3.8 if
> that's
> important). Will this cause any problems?
>

SQLite 3.6.22 is *really* obsolete (2010-01-06); the current version
is 3.8.4.3; updating to a fresher version seems to be appropriate.

anyway, are you absolutely sure you've properly called
spatialite_init()
so to correctly register the extension in your currently used DB
connection ?

bye Sandro

Olof

unread,
May 13, 2014, 2:20:16 AM5/13/14
to spatiali...@googlegroups.com
Hello, and thanks for the answer.
 
It was truly a rookie mistake, and exactly the thing you pointed out at the end of your post.
I did the spatialite_init call when creating the db, but I closed the connection and opened it again to do my inserts, and then I forgot the spatialite_init().
 
Regarding the version of SQLite, it might be useful to upgrade to the latest version, but I don't think thats in the plan right now.
 
Again, thanks!
 
/Olof
Reply all
Reply to author
Forward
0 new messages