Hi Toto',
"the query gives me an error" is too much generic; _WHICH_ error ?
I can just take a blind guess.
As the documentation clearly states [1], all functions related to
Stored Procedures require to be explicitly enabled by setting the
environment variable "SPATIALITE_SECURITY=relaxed"
if not, they'll appear to be unsupported.
spatialite_gui always automatically defines this external
variable, but when using different tools it's under your
responsibility to set the environment as required.
bye Sandro