<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="OPENWEBMAIL" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<font size="2"><b>On Wed, 31 Mar 2010 15:43:12 -0430, Marcelo Reyes wrote</b>
<br />> ... when I try to UPDATE or INSERT anything I get the
folowing
error:
<br />>
<br />> OperationalError: no such functions geometry
constraints
<br />>
<br />
<br />Hi Marcelo,
<br />
<br />the 'GeometryConstraints function not found' issue you are
<br />experiencing can be very easily explained:
<br />
<br />a) you've opened your DB using a recent SpatiaLite's version
<br /> [presumably v.2.4.0-RC, if you're using QGIS 1.4]: in this
<br /> case SpatiaLite silently converts any DB trigger to the
<br /> most recent (and efficient) style.
<br />b) then you are trying to load some obsolete DLL version in
<br /> Python. but you cannot expect obsolete sw to be able
<br /> to support the most recent triggers.
<br />c) the most recent DLL is named 'libspatialite-2.dll', so you
<br /> are obviously using some obsolete DLL
<br />
<br />please, update your DLLs to v.2.4.0-RC:
<br />http://www.gaia-gis.it/spatialite-2.4.0/binaries.html
<br />
<br />
<br />> I'm guessing this is because the libspatialite extension is not
loaded,
<br />> but when I try to load it using query.exec_("SELECT
load_extension('libspatialite-1.dll')") nothing happens.
<br />>
<br />
<br />this point is not at all clear to me: what do you intend when
<br />you state "nothing happens" ?
<br />there are lots of reasons accounting for a failure [bad DLL's path,
<br />SQLite isn't enabled to load dynamic extensions, unresolved symbols ...]
<br />but for sure you'll get some error in this case.
<br />
<br />Anyway, there is a "bomb proof" test you can perform to check
<br />if the DLL was actually loaded or not:
<br />
<br />SELECT spatialite_version();
<br />
<br />if you get back a text string like "2.4.0" it's ok, you can safely
<br />assume the DLL has been succesfully loaded.
<br />otherwise you'll get some error like "no such function spatialite_version"
<br />
<br />bye
<br />Sandro
<br />
<br />
<br />
</font>
</BODY>
</HTML>