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