Re: [sqlite] Math Functions

2008-06-13 Thread Liam Healy
This all makes eminently good sense; thank you for the explanation. I have updated the comments at the head of the file and uploaded a new version, which is now at http://www.sqlite.org/contrib/download/extension-functions.c?get=25. Nothing in the code has changed, so there's no reason to download

Re: [sqlite] Math Functions

2008-06-13 Thread Jay A. Kreibich
On Fri, Jun 13, 2008 at 09:43:51AM -0400, Liam Healy scratched on the wall: > Interesting; I tried it on Debian sid (unstable) and it worked as > well. I guess the statement in > http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions that the > extensions loading mechanism being turned off by

Re: [sqlite] Math Functions

2008-06-13 Thread Liam Healy
On Fri, Jun 13, 2008 at 4:31 AM, Alexey Pechnikov <[EMAIL PROTECTED]> wrote: >> The extension-functions file doesn't actually implement any of the >> math functinos, it simply acts as a glue layer between SQLite and the >> system math library. In this case, it looks like the run-time linker

Re: [sqlite] Math Functions

2008-06-13 Thread Alexey Pechnikov
> The extension-functions file doesn't actually implement any of the > math functinos, it simply acts as a glue layer between SQLite and the > system math library. In this case, it looks like the run-time linker > that loads the extension can't resolve the call for log() from the >

Re: [sqlite] Math Functions

2008-06-12 Thread Jay A. Kreibich
On Thu, Jun 12, 2008 at 04:26:13PM +0400, Alexey Pechnikov scratched on the wall: > В сообщении от Friday 06 June 2008 03:51:38 P Kishor написал(а): > > http://sqlite.org/contrib/download/extension-functions.c?get=22 > > $ wget http://sqlite.org/contrib/download/extension-functions.c?get=22 > $

Re: [sqlite] Math Functions

2008-06-12 Thread Alexey Pechnikov
> Note: You cannot use these functions from the sqlite3 program, you > must write your own program using the sqlite3 API, and call > sqlite3_enable_load_extension. See "Security Considerations" in > http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions. I can load other extensions and use

Re: [sqlite] Math Functions

2008-06-12 Thread Liam Healy
In the file you have downloaded, there is the following statement: Note: You cannot use these functions from the sqlite3 program, you must write your own program using the sqlite3 API, and call sqlite3_enable_load_extension. See "Security Considerations" in

Re: [sqlite] Math Functions

2008-06-12 Thread Alexey Pechnikov
В сообщении от Friday 06 June 2008 03:51:38 P Kishor написал(а): > http://sqlite.org/contrib/download/extension-functions.c?get=22 $ wget http://sqlite.org/contrib/download/extension-functions.c?get=22 $ mv extension-functions.c?get=22 extension-functions.c $ gcc -fPIC -shared

Re: [sqlite] Math Functions

2008-06-05 Thread P Kishor
On 6/5/08, BareFeet <[EMAIL PROTECTED]> wrote: > > requires square root and I'm not sure if I can do this with sqlite. > > Something like: > > > > SELECT PlaceName, sqrt((PlaceX - 1)^2 - (PlaceY - 3)^2) AS > > DistFromHome > > FROM Table WHERE PlaceGroup = 3; > > > I was going to suggest

Re: [sqlite] Math Functions

2008-06-05 Thread Jay A. Kreibich
On Thu, Jun 05, 2008 at 03:55:44PM -0700, Scott Baker scratched on the wall: > I have a database with coordinates in it. I'd like to calculate distance at > the SQL level, but the equation for calculating distance requires square > root and I'm not sure if I can do this with sqlite. Something

Re: [sqlite] Math Functions

2008-06-05 Thread BareFeet
> requires square root and I'm not sure if I can do this with sqlite. > Something like: > > SELECT PlaceName, sqrt((PlaceX - 1)^2 - (PlaceY - 3)^2) AS > DistFromHome > FROM Table WHERE PlaceGroup = 3; I was going to suggest using "^ 0.5" for square root, but now I see that SQLite doesn't

Re: [sqlite] Math Functions

2008-06-05 Thread Alex Katebi
You can do your own custom functions using the C extentions. You should buy the book. "The Definitive Guide SQLite" On Thu, Jun 5, 2008 at 6:55 PM, Scott Baker <[EMAIL PROTECTED]> wrote: > I have a database with coordinates in it. I'd like to calculate distance at > the SQL level, but the

Re: [sqlite] Math functions

2007-04-05 Thread Brad Stiles
> On 4/4/07, Nathan Biggs <[EMAIL PROTECTED]> wrote: > Does anyone know if there is a floor function in sqlite, or of a way to > implement it. > Well, the suggestions about extending SQLite are probably quicker, but if a SQL solution is required for portability, you can try something like this:

Re: [sqlite] Math functions

2007-04-04 Thread Liam Healy
Please see http://sqlite.org/contrib under extension-functions.tgz. On 4/4/07, Nathan Biggs <[EMAIL PROTECTED]> wrote: Does anyone know if there is a floor function in sqlite, or of a way to implement it.

Re: [sqlite] Math functions

2007-04-04 Thread anis chaaba
yes you can implement math functions with user defined functions by the sqlite3_create_function. sqlite.org is your freind :) 2007/4/4, Nathan Biggs <[EMAIL PROTECTED]>: Does anyone know if there is a floor function in sqlite, or of a way to implement it.

[sqlite] Math functions

2007-04-04 Thread Nathan Biggs
Does anyone know if there is a floor function in sqlite, or of a way to implement it.