Re: [sqlite] Extra functions - New Project?

2006-05-25 Thread Eric Bohlman

Mikey C wrote:

StdDev
Variance


When implementing these, make sure *not* to use the "textbook" one-pass 
formula (mean of the squares - square of the mean); it simply doesn't 
work properly in floating point (you can find yourself subtracting one 
large number from another and losing most of your precision).  I believe 
many versions of Excel made that mistake.  There are some numerically 
stable one-pass algorithms for computing variance; search for them if 
you don't want to make two passes.




Re: [sqlite] Extra functions - New Project?

2006-05-25 Thread Alex Charyna

Heh. You learn something new everyday.
If it behaves the same, then it is!
I guess I need to look at the docs again!
thanks...
-alex

On May 25, 2006, at 3:56 PM, Griggs, Donald wrote:

Regarding: A non-standard SQL function I like, and don't think I've  
seen

anywhere but an Aspentech product is SUBSTRING.

Alex,

Is the second option ("positional") not identical to the existing  
"substr"

function?

E.g. for
strFoo = 'abcdefgh';
Instead of
  substring(strFoo from 1 for 4) returning 'abcd'
Use
  substr(strFoo,1,4)

http://sqlite.org/lang_expr.html

Donald Griggs


Opinions are not necessarily those of Misys Healthcare Systems nor  
its board

of directors.





RE: [sqlite] Extra functions - New Project?

2006-05-25 Thread Griggs, Donald
Regarding: A non-standard SQL function I like, and don't think I've seen
anywhere but an Aspentech product is SUBSTRING.
 
Alex,

Is the second option ("positional") not identical to the existing "substr"
function?

E.g. for
strFoo = 'abcdefgh';
Instead of
  substring(strFoo from 1 for 4) returning 'abcd'
Use
  substr(strFoo,1,4) 

http://sqlite.org/lang_expr.html

Donald Griggs


Opinions are not necessarily those of Misys Healthcare Systems nor its board
of directors.



Re: [sqlite] Extra functions - New Project?

2006-05-25 Thread Alex Charyna
I tend to use SQLLite via the command line, feeding in queries from  
an external file.


A non-standard SQL function I like, and don't think I've seen  
anywhere but an Aspentech product is SUBSTRING.


It works in two ways

1 - Delimited

strFoo = 'abcd efgh';
substring(1 of strFoo between ' ') = 'abcd'

strFoo = 'abcd,efgh';
substring(2 of strFoo between ',') = 'efgh'

2 - Positional

strFoo = 'abcdefgh';
substring(strFoo from 1 for 4) = 'abcd'
substring(strFoo from 4 for 4) = 'defg'

I'd be interested in seeing that. If I can be of help, feel free to ask.


-alex


On May 25, 2006, at 7:35 AM, Mikey C wrote:



With some assistance I intend to implement pretty much all the SQL  
Server
2000 arithmetic and string functions into SQLite 3 codebase as well  
as a few

others, such as aggregates for StdDev and Variance.

I will then release the source under the same license as SQLite  
itself.


If anyone has any comments or suggestions, please let me know.
--
View this message in context: http://www.nabble.com/Extra+functions 
+-+New+Project--t1674436.html#a4559014

Sent from the SQLite forum at Nabble.com.





Re: [sqlite] Extra functions - New Project?

2006-05-25 Thread Mikey C

These are the functions that I tend to have implemented:

Numeric Functions:

Sqrt
Floor
Ceiling
Sign
Pi - constant function 3.141..
ACos
ASin
ATan
Atn2
Cos
Cot
Degrees
Exp
Log
Log10
Power
Radians
Sin
Square
Tan

String Functions:

Charindex
Patindex
Left
Right
LTrim
RTrim
Trim
Replicate
Reverse
Replace
Difference - numeric diff in Soundex values using built in soundex function.

Aggregate Functions:

StdDev
Variance
Median - Possibly a more flexible function Percentile where 0.5 is the
Median
Mode - Most frequently occuring value
--
View this message in context: 
http://www.nabble.com/Extra+functions+-+New+Project--t1674436.html#a4563121
Sent from the SQLite forum at Nabble.com.



Re: [sqlite] Extra functions - New Project?

2006-05-25 Thread John Stanton
Good idea.  I can help with code and ideas.  Contact me at 
[EMAIL PROTECTED]


Mikey C wrote:

With some assistance I intend to implement pretty much all the SQL Server
2000 arithmetic and string functions into SQLite 3 codebase as well as a few
others, such as aggregates for StdDev and Variance.

I will then release the source under the same license as SQLite itself.

If anyone has any comments or suggestions, please let me know.
--
View this message in context: 
http://www.nabble.com/Extra+functions+-+New+Project--t1674436.html#a4559014
Sent from the SQLite forum at Nabble.com.





Re: [sqlite] SQLite under mono

2006-05-25 Thread Ben Clewett

Thanks for you help, this is exactly what I was trying to find.

Regards, Ben

Mikey C wrote:

http://www.mono-project.com/SQL_Lite
--
View this message in context: 
http://www.nabble.com/SQLite+under+mono-t1680769.html#a4558894
Sent from the SQLite forum at Nabble.com.





Re: [sqlite] Extra functions - New Project?

2006-05-25 Thread Mikey C

With some assistance I intend to implement pretty much all the SQL Server
2000 arithmetic and string functions into SQLite 3 codebase as well as a few
others, such as aggregates for StdDev and Variance.

I will then release the source under the same license as SQLite itself.

If anyone has any comments or suggestions, please let me know.
--
View this message in context: 
http://www.nabble.com/Extra+functions+-+New+Project--t1674436.html#a4559014
Sent from the SQLite forum at Nabble.com.



Re: [sqlite] SQLite under mono

2006-05-25 Thread Mikey C

http://www.mono-project.com/SQL_Lite
--
View this message in context: 
http://www.nabble.com/SQLite+under+mono-t1680769.html#a4558894
Sent from the SQLite forum at Nabble.com.



[sqlite] SQLite under mono

2006-05-25 Thread Ben Clewett

Dear SQLite,

I have need to access SQLite using Mono on Linux.

Probably using C# .NET code either natively accessing an sqlite3 
database, or calling libsqlite3.so.0.


I can't see any native .NET drivers for sqlite3, which is where I would 
like to go.


Do any members know if such a lib does exist?  If not, any body got any 
experience of binding mono to the native Linux sqlite3 lib?


Thanks,

Ben