Liam Healy ([info]lhealy) wrote,
@ 2007-03-30 09:59:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:lisp, sqlite

SQLite math and string functions simplified
Thanks to Mikey C, there are now a number of math and string functions available in SQLite SQL queries. I blogged this before, but now I have simplified and cleaned up his code, and made it available.

The functions are: Math: acos, asin, atan, atn2, atan2, acosh, asinh, atanh, difference, degrees, radians, cos, sin, tan, cot, cosh, sinh, tanh, coth, exp, log, log10, power, sign, sqrt, square, ceil, floor, pi. String: replicate, charindex, leftstr, rightstr, ltrim, rtrim, trim, replace, reverse, proper, padl, padr, padc, strfilter.

For CLSQL users, the Lisp portion of the instructions in my previous post remain the same.




(Post a new comment)


(Anonymous)
2007-04-25 06:54 pm UTC (link)
hello

i donwload the zip, my code
gcc -I/usr/include/ -I/usr/include/src -fPIC func_ext.c map.c -shared -o libsqlitefunctions.so

I have a lot of error like that

func_ext.c:264: error: 'SQLITE_NULL' undeclared (first use in this function)
func_ext.c:265: error: 'context' undeclared (first use in this function)
func_ext.c: At top level:
func_ext.c:282: error: parse error before '*' token
func_ext.c: In function 'atn2Func':
func_ext.c:286: error: 'argc' undeclared (first use in this function)
func_ext.c:288: error: 'argv' undeclared (first use in this function)
func_ext.c:288: error: 'SQLITE_NULL' undeclared (first use in this function)


thanks

(Reply to this) (Thread)


[info]lhealy
2007-04-27 02:03 am UTC (link)
Please see the README
gcc -Isqlite -Isqlite/src -fPIC func_ext.c map.c -shared -o libsqlitefunctions.so
is the command you want, where sqlite is the path to the sqlite source directory in which you have run config and make.

(Reply to this) (Parent)

Dead link
[info]wanderinghorse.net
2007-09-27 01:42 pm UTC (link)
FYI: It appears that the link to extension-functions.tgz is now dead - it returns 0 bytes.

(Reply to this) (Thread)

Re: Dead link
[info]lhealy
2007-09-27 11:05 pm UTC (link)
It has been merged into one file, a C source file, with instructions given as a comment at the top.
http://sqlite.org/contrib/download/extension-functions.c?get=22

(Reply to this) (Parent)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…