Re: [sqlite] 3.2.7 and russian characters

2005-10-12 Thread Slavomir Svetlik
>   Why 3.2.7 version can not open database with path that contains

>   russian characters?

>

> Best regards  Sergey Startsev



I can not open database with sqlite.dll v. 3.2.7 which contains slovak 
characters too. For example with 3.2.2 this is no problem.


__
Web hosting a registrácia domén za skvelé ceny - http://www.superhosting.sk/




[sqlite] 3.2.7 and russian characters

2005-10-12 Thread Sergey Startsev
Hi all!

  Why 3.2.7 version can not open database with path that contains
  russian characters?

-- 
Best regards

 Sergey Startsev
 SQLite Analyzer - SQLite database management tool with GUI.
 http://www.kraslabs.com/sqlite_analyzer.html




Re: [sqlite] SQLite is Awesome

2005-10-12 Thread Edward Wilson
Ditto [almost]

Anyone who blesses the world with such a great gift can spell however they want 
... 

Sqlite is a 'weapon of the warriors' -- it completely changes the game.

Thanks Mr. Hipp, and congrats on your well deserved award.

-
e


--- Chris Gurtler <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Ok, so Mr. Hipp's spelling may need a little work, but SQLite has got to be 
> the best bit of
> software that I have come accross for quite a while.
> 
> Thank you !!
> 
> 
> Regards,
> 
> Chris
> 
> 
> 
> 
> 
> 




__ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/


Re: [sqlite] windowing functions != recursive functions

2005-10-12 Thread drh
"pilot pirx" <[EMAIL PROTECTED]> wrote:
 
> Now, for the recursive function like exponential moving average 
> the defintion is that
>
> ema(i+1) =  val(i) * coef  + ema(i) * (1-coef).
>
> That is I have to know the previous value of both EMA _and_  VALUE 
> (while for moving avearage I need to know _only_ the previous value(s)
> of VALUE. 
> 

You could write an "ema()" function for SQLite using the
scarcely documented API functions sqlite3_get_auxdata() and
sqlite3_set_auxdata().  (Those routines were intended to allow
functions like "regexp" to compile a constant regular expression
once and then reused the compiled regular expression on
subsequent calls.  But they have never been used for anything,
as far as I am aware.)

The ema() function would work like this:

   SELECT ema(x, 0.45) FROM table1;

Where 0.45 is the "coef".

I was wondering if it would be possible to write a "prev()"
function that returned the value of a column in the result
set from the previous row.  prev() could be used to implement
ema() in pure SQL.  But, alas, I do not see how you could
write a general-purpose prev() function using the current
API.  Some kind of extension would be required, I think.
--
D. Richard Hipp <[EMAIL PROTECTED]>



[sqlite] wiindow functions and recursive functions

2005-10-12 Thread pilot pirx
> I don't see why this is such a great feature.  Without it, worst case,
> you could still write a simple little loop which would issue one
> update statement for each row, all within a single transaction.  No?

that would require writing in C, bindind etc. Or, for some other databases,
writing in some stored procedure language. Here I have that with
stadard-looking sql in a small database. One 'quirk' of the implementation
(i am not sure it was intended) gives enormous additional
programming facility without any additional work :-)

> > Vastly more useful for moving average and the like would be real
> > windowing/grouping functions, like Oracle's "analytic" functions.  I'm

Example of computing moving average with standard sql is in one of my earlier 
mails.
I think that adding OLAP functions to such a small engine would be an overkill,
especially as most such functionality can be expressed with standard SQL
(admittedly, convoluted a bit).
The owner of the project will ultimately decide. 
It may not fit into the 'lite' 
image this project is after.


P.S. I remember seeing a public domain code adding 
correlation and regression to SQLite, but it was
about 3 years old - it was rather short. Yet, even that
did not make it into the mainstream project. 

- Original Message -
From: "Andrew Piskorski" <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Subject: [sqlite] SQL Window/OLAP functions
Date: Wed, 12 Oct 2005 08:34:02 -0400

> 
> On Wed, Oct 12, 2005 at 05:12:05AM -0500, pilot pirx wrote:
> > Subject: [sqlite] Please, please do _not_ remove this feature from SQLite...
> 
> > While using SQLite for some time (with R package, www.r-project.org)
> > I did admire its functionality and speed. Then I did discover a
> > hidden SQLite feature of immense usefulness - not available in other
> > databases. SQLite can compute Fibonacci numbers! (I will explain why
> 
> Transaction visibility features do vary, although often it doesn't
> matter anyway.  E.g., here's a dicussion of how (at least as of early
> 2004), PostgreSQL's docs were quite confused about certain subtleties,
> but what I find interesting, is this was still something that in
> practice had never really mattered to the mostly hard-core RDBMS
> programmers talking about it in that thread:
> 
>http://openacs.org/forums/message-view?message_id=176198
> 
> > UPDATE fib SET
> > val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
> >(SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
> > WHERE pos > 2;
> 
> I don't see why this is such a great feature.  Without it, worst case,
> you could still write a simple little loop which would issue one
> update statement for each row, all within a single transaction.  No?
> 
> > This is an _immensely_ useful functionality when one needs to
> > compute various recursive functions. For example exponential moving
> > average, used frequently in financials. Or Kalman filter (and many
> 
> Vastly more useful for moving average and the like would be real
> windowing/grouping functions, like Oracle's "analytic" functions.  I'm
> not thrilled by their particular syntax, but the functionality is
> INCREDIBLY useful.  (And on the other hand, I haven't thought of any
> obviously better syntax, either.)
> 
> Hm, an amendement to the SQL:1999 spec added windowing support, and
> SQL:2003 includes that, I think as features T611, "Elementrary OLAP
> functions" and T612, "Advanced OLAP functions".  Apparently Fred Zemke
> of Oracle was the author of that SQL spec, and IBM also supported it,
> so the SQL:2003 syntax and behavior is probably very similar (maybe
> identical?) to what Oracle 8i, 9i, and 10g and IBM's DB2 already have.
> PostgreSQL, as of 8.0, doesn't support it yet.
> 
>http://www.wintercorp.com/rwintercolumns/SQL_99snewolapfunctions.html
>http://www.ncb.ernet.in/education/modules/dbms/SQL99/OLAP-99-154r2.pdf
>http://www.wiscorp.com/sql/SQL2003Features.pdf
>http://troels.arvin.dk/db/rdbms/#select-limit-offset
>http://www.postgresql.org/docs/8.0/interactive/features.html
>http://en.wikipedia.org/wiki/SQL
>http://www.sigmod.org/sigmod/record/issues/0403/E.JimAndrew-standard.pdf
>http://www.oracle.com/oramag/oracle/01-jul/o41industry.html
> 
> SQLite basically supports just SQL-92, it doesn't have any of these
> newer SQL:1999 or SQL:2003 features, right?
> 
> Using SQLite in conjunction with a powerful statistical data analysis
> programming language like R is an excellent example of a use where
> windowing functions can be hugely helpful.  Unfortunately, I've never
> had a compelling need to use SQLite for that, otherwise I'd probably
> take a shot at adding support for the SQL:2003 Window/OLAP stuff.  :)
> 
> --
> Andrew Piskorski <[EMAIL PROTECTED]>
> http://www.piskorski.com/


-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



[sqlite] windowing functions != recursive functions

2005-10-12 Thread pilot pirx
I was unaware of the windowing functions discusssion.
Having a look at the first link, it looks like we may be
talking about two subtly different issues.
The windowing functions described in the link
are different from recursive functions. 
There is no problem in computing moving average
or cumulative sum etc 
with the existing SQL (or dealing with time windows
in general)  - it just the SQL gets nasty - examples
are in 'SQL for smarties' by Joe Celko. Therefore
adding such functions to SQLite is 'nice' but does
not really increase the functionality.

In contrast, computation of the recursion function
adds it. 

example with moving averages, since they
are mentioned in the windowing functions

assuming original series is
VALUE = 1 2 3 4 5 6 7

following statement will compute 5-day moving average for the whole column
UPDATE data SET 
MAVE5 = (SELECT AVG(val) FROM data AS h1 WHERE h1.dayno <=  data.dayno 
AND h1.dayno > data.dayno-05);
But this statement operates always on existing data in the existing column - to 
compute new value of MAVE5 it only needs to know values of VALUE. (When, for 
the element one, there is not enough data (because there is no dayno < 1)  SQL 
simply averages over existing data.)

Now, for the recursive function like exponential moving average the defintion 
is that
ema(i+1) =  val(i) * coef  + ema(i) * (1-coef). That is I have to know the 
previous value of
both EMA _and_  VALUE (while for moving avearage I need to know _only_
the previous value(s) of VALUE. 


- Original Message -
From: "Andrew Piskorski" <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Subject: [sqlite] SQL Window/OLAP functions
Date: Wed, 12 Oct 2005 08:34:02 -0400

> 
> On Wed, Oct 12, 2005 at 05:12:05AM -0500, pilot pirx wrote:
> > Subject: [sqlite] Please, please do _not_ remove this feature from SQLite...
> 
> > While using SQLite for some time (with R package, www.r-project.org)
> > I did admire its functionality and speed. Then I did discover a
> > hidden SQLite feature of immense usefulness - not available in other
> > databases. SQLite can compute Fibonacci numbers! (I will explain why
> 
> Transaction visibility features do vary, although often it doesn't
> matter anyway.  E.g., here's a dicussion of how (at least as of early
> 2004), PostgreSQL's docs were quite confused about certain subtleties,
> but what I find interesting, is this was still something that in
> practice had never really mattered to the mostly hard-core RDBMS
> programmers talking about it in that thread:
> 
>http://openacs.org/forums/message-view?message_id=176198
> 
> > UPDATE fib SET
> > val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
> >(SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
> > WHERE pos > 2;
> 
> I don't see why this is such a great feature.  Without it, worst case,
> you could still write a simple little loop which would issue one
> update statement for each row, all within a single transaction.  No?
> 
> > This is an _immensely_ useful functionality when one needs to
> > compute various recursive functions. For example exponential moving
> > average, used frequently in financials. Or Kalman filter (and many
> 
> Vastly more useful for moving average and the like would be real
> windowing/grouping functions, like Oracle's "analytic" functions.  I'm
> not thrilled by their particular syntax, but the functionality is
> INCREDIBLY useful.  (And on the other hand, I haven't thought of any
> obviously better syntax, either.)
> 
> Hm, an amendement to the SQL:1999 spec added windowing support, and
> SQL:2003 includes that, I think as features T611, "Elementrary OLAP
> functions" and T612, "Advanced OLAP functions".  Apparently Fred Zemke
> of Oracle was the author of that SQL spec, and IBM also supported it,
> so the SQL:2003 syntax and behavior is probably very similar (maybe
> identical?) to what Oracle 8i, 9i, and 10g and IBM's DB2 already have.
> PostgreSQL, as of 8.0, doesn't support it yet.
> 
>http://www.wintercorp.com/rwintercolumns/SQL_99snewolapfunctions.html
>http://www.ncb.ernet.in/education/modules/dbms/SQL99/OLAP-99-154r2.pdf
>http://www.wiscorp.com/sql/SQL2003Features.pdf
>http://troels.arvin.dk/db/rdbms/#select-limit-offset
>http://www.postgresql.org/docs/8.0/interactive/features.html
>http://en.wikipedia.org/wiki/SQL
>http://www.sigmod.org/sigmod/record/issues/0403/E.JimAndrew-standard.pdf
>http://www.oracle.com/oramag/oracle/01-jul/o41industry.html
> 
> SQLite basically supports just SQL-92, it doesn't have any of these
> newer SQL:1999 or SQL:2003 features, right?
> 
> Using SQLite in conjunction with a powerful statistical data analysis
> programming language like R is an excellent example of a use where
> windowing functions can be hugely helpful.  Unfortunately, I've never
> had a compelling need to use SQLite for that, otherwise I'd probably
> take a shot at adding support for the SQL:2003 Window/OLAP stuff.  

Re: [sqlite] SQL Window/OLAP functions

2005-10-12 Thread pilot pirx
I did use R extensively for years and with SQLite for the last year. 
My observations, for what they are worth, about statistics and databases.

A stats package, especially as powerful as R, makes any database functions
less relevant. After trying various approaches I use now the database mostly 
 - to reduce data somewhat before getting them to R. 
   For example, with 2 mln records in 500 groups I can compute group 
   averages in the database and read into R only 500 records. 
- to reduce overall memory requirements - I can process the whole 
  data set on group-by-group basis - reading one group at a time.
  thus requiring less memory internally

Any stats package will have many functions, most of them impossible to
implement in standard SQL and very difficult to implement in general.
(like clustering etc).

So why do I write filters in the database, instead of using vastly superior 
R capabilities? Firstly, for fun - just liked to push SQL as far as possible.
Secondly - it is sometimes useful to compute some basic things during
or immediately after data acquisition. If we can compute some 
_simple_ metrics at that stage _quickly_ then R does not have to
read and process that much, as only data withing some range of metric
may be of interest. Also, we can index on a metric and provide very
fast extraction of data subsets.

In summary it seems to me that adding too heavy functions to any database
may be difficult and, for SQLite, going against the basic idea of 
having a 'lite' db. 






- Original Message -
From: Laurent <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] SQL Window/OLAP functions
Date: Wed, 12 Oct 2005 15:36:22 +0200

> 
> Hello,
> 
> I was just looking for a statiscal package linked with SQLITE.
> >
> > Using SQLite in conjunction with a powerful statistical data analysis
> > programming language like R is an excellent example of a use where
> > windowing functions can be hugely helpful.  Unfortunately, I've never
> > had a compelling need to use SQLite for that, otherwise I'd probably
> > take a shot at adding support for the SQL:2003 Window/OLAP stuff.  :)
> >
> I can confirm that there would be some interest in having such a library.
> 
> Best regards,
> 
> Laurent.
> 
> ==
> 
> - Original Message -
> From: "Andrew Piskorski" <[EMAIL PROTECTED]>
> To: 
> Sent: Wednesday, October 12, 2005 2:34 PM
> Subject: [sqlite] SQL Window/OLAP functions
> 
> 
> > On Wed, Oct 12, 2005 at 05:12:05AM -0500, pilot pirx wrote:
> > > Subject: [sqlite] Please, please do _not_ remove this feature from
> SQLite...
> >
> > > While using SQLite for some time (with R package, www.r-project.org)
> > > I did admire its functionality and speed. Then I did discover a
> > > hidden SQLite feature of immense usefulness - not available in other
> > > databases. SQLite can compute Fibonacci numbers! (I will explain why
> >
> > Transaction visibility features do vary, although often it doesn't
> > matter anyway.  E.g., here's a dicussion of how (at least as of early
> > 2004), PostgreSQL's docs were quite confused about certain subtleties,
> > but what I find interesting, is this was still something that in
> > practice had never really mattered to the mostly hard-core RDBMS
> > programmers talking about it in that thread:
> >
> >   http://openacs.org/forums/message-view?message_id=176198
> >
> > > UPDATE fib SET
> > > val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
> > >(SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
> > > WHERE pos > 2;
> >
> > I don't see why this is such a great feature.  Without it, worst case,
> > you could still write a simple little loop which would issue one
> > update statement for each row, all within a single transaction.  No?
> >
> > > This is an _immensely_ useful functionality when one needs to
> > > compute various recursive functions. For example exponential moving
> > > average, used frequently in financials. Or Kalman filter (and many
> >
> > Vastly more useful for moving average and the like would be real
> > windowing/grouping functions, like Oracle's "analytic" functions.  I'm
> > not thrilled by their particular syntax, but the functionality is
> > INCREDIBLY useful.  (And on the other hand, I haven't thought of any
> > obviously better syntax, either.)
> >
> > Hm, an amendement to the SQL:1999 spec added windowing support, and
> > SQL:2003 includes that, I think as features T611, "Elementrary OLAP
> > functions" and T612, "Advanced OLAP functions".  Apparently Fred Zemke
> > of Oracle was the author of that SQL spec, and IBM also supported it,
> > so the SQL:2003 syntax and behavior is probably very similar (maybe
> > identical?) to what Oracle 8i, 9i, and 10g and IBM's DB2 already have.
> > PostgreSQL, as of 8.0, doesn't support it yet.
> >
> >   http://www.wintercorp.com/rwintercolumns/SQL_99snewolapfunctions.html
> >   

Re: [sqlite] fdatasync and 3.2.7

2005-10-12 Thread drh
"Fletcher Mattox" <[EMAIL PROTECTED]> wrote:
> Hi.
> 
> I'm new.  I searched the archives and see where the problem
> of an undefined fdatasync in 3.2.6 was discussed.  I assumed
> it was fixed, but I just got it in 3.2.7 under Solaris 9, which
> defines _POSIX_SYNCHRONIZED_IO.  This define triggers the
> error.  Am I missing something obvious?
> 

http://www.sqlite.org/cvstrac/chngview?cn=2741

SQLite now uses only fsync by default. Only if the configure
script detects the fdatasync function does it attempt to use
fdatasync.  

The change will appear in the next release.

You can always do "-Dfdatasync=fsync" on your compiler
command line to clear the problem in the meantime.
--
D. Richard Hipp <[EMAIL PROTECTED]>



[sqlite] fdatasync and 3.2.7

2005-10-12 Thread Fletcher Mattox
Hi.

I'm new.  I searched the archives and see where the problem
of an undefined fdatasync in 3.2.6 was discussed.  I assumed
it was fixed, but I just got it in 3.2.7 under Solaris 9, which
defines _POSIX_SYNCHRONIZED_IO.  This define triggers the
error.  Am I missing something obvious?

Thanks
Fletcher


Re: [sqlite] SQL Window/OLAP functions

2005-10-12 Thread rbundy

Seconded.



|-+>
| |   "Laurent"|
| |   <[EMAIL PROTECTED]|
| |   ternet.fr>   |
| ||
| |   12/10/2005 23:36 |
| |   Please respond to|
| |   sqlite-users |
| ||
|-+>
  
>--|
  | 
 |
  |   To:      
 |
  |   cc:   
 |
  |   Subject:  Re: [sqlite] SQL Window/OLAP functions  
 |
  
>--|




Hello,

I was just looking for a statiscal package linked with SQLITE.
>
> Using SQLite in conjunction with a powerful statistical data analysis
> programming language like R is an excellent example of a use where
> windowing functions can be hugely helpful.  Unfortunately, I've never
> had a compelling need to use SQLite for that, otherwise I'd probably
> take a shot at adding support for the SQL:2003 Window/OLAP stuff.  :)
>
I can confirm that there would be some interest in having such a library.

Best regards,

Laurent.

==

- Original Message -
From: "Andrew Piskorski" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, October 12, 2005 2:34 PM
Subject: [sqlite] SQL Window/OLAP functions


> On Wed, Oct 12, 2005 at 05:12:05AM -0500, pilot pirx wrote:
> > Subject: [sqlite] Please, please do _not_ remove this feature from
SQLite...
>
> > While using SQLite for some time (with R package, www.r-project.org)
> > I did admire its functionality and speed. Then I did discover a
> > hidden SQLite feature of immense usefulness - not available in other
> > databases. SQLite can compute Fibonacci numbers! (I will explain why
>
> Transaction visibility features do vary, although often it doesn't
> matter anyway.  E.g., here's a dicussion of how (at least as of early
> 2004), PostgreSQL's docs were quite confused about certain subtleties,
> but what I find interesting, is this was still something that in
> practice had never really mattered to the mostly hard-core RDBMS
> programmers talking about it in that thread:
>
>   http://openacs.org/forums/message-view?message_id=176198
>
> > UPDATE fib SET
> > val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
> >(SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
> > WHERE pos > 2;
>
> I don't see why this is such a great feature.  Without it, worst case,
> you could still write a simple little loop which would issue one
> update statement for each row, all within a single transaction.  No?
>
> > This is an _immensely_ useful functionality when one needs to
> > compute various recursive functions. For example exponential moving
> > average, used frequently in financials. Or Kalman filter (and many
>
> Vastly more useful for moving average and the like would be real
> windowing/grouping functions, like Oracle's "analytic" functions.  I'm
> not thrilled by their particular syntax, but the functionality is
> INCREDIBLY useful.  (And on the other hand, I haven't thought of any
> obviously better syntax, either.)
>
> Hm, an amendement to the SQL:1999 spec added windowing support, and
> SQL:2003 includes that, I think as features T611, "Elementrary OLAP
> functions" and T612, "Advanced OLAP functions".  Apparently Fred Zemke
> of Oracle was the author of that SQL spec, and IBM also supported it,
> so the SQL:2003 syntax and behavior is probably very similar (maybe
> identical?) to what Oracle 8i, 9i, and 10g and IBM's DB2 already have.
> PostgreSQL, as of 8.0, doesn't support it yet.
>
>   http://www.wintercorp.com/rwintercolumns/SQL_99snewolapfunctions.html
>   http://www.ncb.ernet.in/education/modules/dbms/SQL99/OLAP-99-154r2.pdf
>   http://www.wiscorp.com/sql/SQL2003Features.pdf
>   http://troels.arvin.dk/db/rdbms/#select-limit-offset
>   http://www.postgresql.org/docs/8.0/interactive/features.html
>   http://en.wikipedia.org/wiki/SQL
>
http://www.sigmod.org/sigmod/record/issues/0403/E.JimAndrew-standard.pdf
>   http://www.oracle.com/oramag/oracle/01-jul/o41industry.html
>
> SQLite basically supports just SQL-92, it doesn't have any of these
> newer SQL:1999 or SQL:2003 features, right?
>
> Using SQLite in conjunction with a powerful statistical data analysis
> programming language like R is an excellent example of a use where
> windowing functions can be hugely helpful.  Unfortunately, I've never
> had a compelling 

[sqlite] RE: full column names in 3.2.7

2005-10-12 Thread Radu Lodina
Hi,

This pragma works for me (3.2.7):

sqlite> pragma short_column_names=0;
sqlite> pragma full_column_names=1;
sqlite> .header on


Set short_ = 0 and full_ = 1

You can check the curent value of pragma directive with: pragma 


sqlite> pragma short_column_names;
0  // -> display of short column name deactivated


sqlite> pragma full_column_names;
1  // -> display of full column name ACTIVATED

Regards
Radu Lodina


[sqlite] How to retreive (for a column): original field name and base table name from a sqlite3_stmt*

2005-10-12 Thread Radu Lodina
Hi,

1. Retrieve original field name:

 CREATE TABLE A (ID int, Name );
SELECT ID AS MyID, Name As MyName FROM A

sqlite3_column_name - return the alias MyID - It's a way to obtain the real
name of column (ID) based on sqlite3_stmt* pointer ?

2. Retrieve base table name:

 CREATE TABLE B (ID int );
SELECT B.ID  AS MyID, A.Name As MyName FROM A LEFT OUTER JOIN B
ON A.ID  = B.ID 

It's there a way to obtain the base table name for MyID field (B).


For both case I only have sqlite3_stmt* pointer ( parse sqlStatement string
it's not a acceptable solution).

Thank you.


Regards
Radu Lodina


[sqlite] SQLite vs. Firebird wiki page

2005-10-12 Thread Robert Simpson
I don't really want to update it myself, but under the section regarding the 
database sizes being similar -- I've found that not to be the case at least 
in the one very simplistic case I tried:


Using the following schema:
CREATE TABLE Foo ([Id] INTEGER NOT NULL PRIMARY KEY)

Inserting 100,000 items into a sqlite and firebird database, then updating 
all 100,000 with an UPDATE statement, the final database size was:


SQLite (3.2.5) :   819,200 bytes
Firebird (1.5.2.4731 embedded) : 8,736,768 bytes

Robert




RE: [sqlite] vxworks

2005-10-12 Thread Mr. Tezozomoc

We have been successfully been using sqlite in several flavors of Vxworks.

I have ported it over to PPC604, X86, and PC_SIM.

We had to do some kludging to get it to work concurrently and coherently.

1.  We modified os.c and added a semaphore for the singleton file.
2.  We wrote our own arbitration handle between processes so, if one 
data base is common across tasks, it needs arbitration and separate handles 
to it.
3.  If you plan on using in memory databases we switched them over to a ram 
drive and it the rest of the arbitration works just fine.


We have used this port successfully across several projects.

Please let me know if this helps.

Tezozomoc.


Original Message Follows
From: Martin Pfeifle <[EMAIL PROTECTED]>
Reply-To: sqlite-users@sqlite.org
To: sqlite-users@sqlite.org
Subject: [sqlite] vxworks
Date: Wed, 12 Oct 2005 15:01:32 +0200 (CEST)

Hi,
I am in deep trouble. I would like to use sqlite on
vxworks. There are no fysnc, fcntl calls available
which are used in os_unix.c.
Can anybody help me? PLEASE!







___
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: 
http://mail.yahoo.de





Re: [sqlite] sqlite and spatial extension

2005-10-12 Thread Noel Frankinet

Rajan, Vivek K wrote:

Hello- 


Are there spatial extensions available for sqlite? And/or is there any
add-on library/shareware/freeware which can enable spatial
extensions/queries with SQLite? 


Rajan



 


Hello,

None that I'm aware of also I do use sqlite to store geagraphical info, 
but as a blob.
I have a crude spatial indexing but I would like to find a better 
solution. Any idea ?


--
Noël Frankinet
Gistek Software SA
http://www.gistek.net



[sqlite] vxworks

2005-10-12 Thread Martin Pfeifle
Hi,
I am in deep trouble. I would like to use sqlite on
vxworks. There are no fysnc, fcntl calls available
which are used in os_unix.c. 
Can anybody help me? PLEASE!







___ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: 
http://mail.yahoo.de


[sqlite] SQL Window/OLAP functions

2005-10-12 Thread Andrew Piskorski
On Wed, Oct 12, 2005 at 05:12:05AM -0500, pilot pirx wrote:
> Subject: [sqlite] Please, please do _not_ remove this feature from SQLite...

> While using SQLite for some time (with R package, www.r-project.org)
> I did admire its functionality and speed. Then I did discover a
> hidden SQLite feature of immense usefulness - not available in other
> databases. SQLite can compute Fibonacci numbers! (I will explain why

Transaction visibility features do vary, although often it doesn't
matter anyway.  E.g., here's a dicussion of how (at least as of early
2004), PostgreSQL's docs were quite confused about certain subtleties,
but what I find interesting, is this was still something that in
practice had never really mattered to the mostly hard-core RDBMS
programmers talking about it in that thread:

  http://openacs.org/forums/message-view?message_id=176198

> UPDATE fib SET
> val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
>(SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
> WHERE pos > 2;

I don't see why this is such a great feature.  Without it, worst case,
you could still write a simple little loop which would issue one
update statement for each row, all within a single transaction.  No?

> This is an _immensely_ useful functionality when one needs to
> compute various recursive functions. For example exponential moving
> average, used frequently in financials. Or Kalman filter (and many

Vastly more useful for moving average and the like would be real
windowing/grouping functions, like Oracle's "analytic" functions.  I'm
not thrilled by their particular syntax, but the functionality is
INCREDIBLY useful.  (And on the other hand, I haven't thought of any
obviously better syntax, either.)

Hm, an amendement to the SQL:1999 spec added windowing support, and
SQL:2003 includes that, I think as features T611, "Elementrary OLAP
functions" and T612, "Advanced OLAP functions".  Apparently Fred Zemke
of Oracle was the author of that SQL spec, and IBM also supported it,
so the SQL:2003 syntax and behavior is probably very similar (maybe
identical?) to what Oracle 8i, 9i, and 10g and IBM's DB2 already have.
PostgreSQL, as of 8.0, doesn't support it yet.

  http://www.wintercorp.com/rwintercolumns/SQL_99snewolapfunctions.html
  http://www.ncb.ernet.in/education/modules/dbms/SQL99/OLAP-99-154r2.pdf
  http://www.wiscorp.com/sql/SQL2003Features.pdf
  http://troels.arvin.dk/db/rdbms/#select-limit-offset
  http://www.postgresql.org/docs/8.0/interactive/features.html
  http://en.wikipedia.org/wiki/SQL
  http://www.sigmod.org/sigmod/record/issues/0403/E.JimAndrew-standard.pdf
  http://www.oracle.com/oramag/oracle/01-jul/o41industry.html

SQLite basically supports just SQL-92, it doesn't have any of these
newer SQL:1999 or SQL:2003 features, right?

Using SQLite in conjunction with a powerful statistical data analysis
programming language like R is an excellent example of a use where
windowing functions can be hugely helpful.  Unfortunately, I've never
had a compelling need to use SQLite for that, otherwise I'd probably
take a shot at adding support for the SQL:2003 Window/OLAP stuff.  :)

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


[sqlite] Please, please do _not_ remove this feature from SQLite...

2005-10-12 Thread pilot pirx
While using SQLite for some time (with R package, www.r-project.org) I did 
admire its functionality and speed. Then I did discover a hidden SQLite feature 
of immense usefulness - not available in other databases. SQLite can compute 
Fibonacci numbers! (I will explain why this is important later).

The are defined as follows: F1 = 1, F2 = 1; F3 = F1 + F2; F4 = F2 +F3  etc. So 
they are defined recursively, with the first two values known and each next 
value depending on the previous values. The SQL statement for that is (the full 
script at the end of this mail):

UPDATE fib SET
val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
   (SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
WHERE pos > 2;

Now, in the standard SQL that should result in: 1,1,2,null,null,null... - 
because the assumption is that the operations on all rows are done at the same 
time.  So F4 will get null, because F3 was null etc. All other databases seem 
to do it - I tested HSQLDB, Firebird, SQLServer, Derby. 

Fortunately (for me) SQLite apparently stores rows after computation and the 
previous row's value is available when the next row is being computed. Also, 
the operations are executed in row order.  So I do get 1,1, 2, 3, 5, 8 ... 
(though some table/index declarations have to be right to achieve that for 
larger tables).

This is an _immensely_ useful functionality when one needs to compute various 
recursive functions. For example exponential moving average, used frequently in 
financials. Or Kalman filter (and many other filters) used in data smoothing 
and analysis.  Naturally, one could argue that databases are not for numerical 
computations. But it is very useful to be able to do simple computations in 
database,  especially if one does not have to write stored procedures or write 
external procedures for that - in essence getting something for free and 
without added complexity. So I hope that this feature will stay...


P.S. On somewhat related note: since sqlite is written in C - why it does not 
expose some basic functions from the standard C library (log, exp, sqrt, sin), 
at least optionally? Understandably, the idea is to keep it 'lite'. But, may 
be, an approach similar to ant and other packages could be applied to SQLite - 
that is there is a set of standard (but still simple) extensions, including 
things which may add some bulk, but do not require any large implementation 
effort.


= the test

DROP TABLE fib;
CREATE TABLE fib ( pos INTEGER, val INTEGER);
CREATE UNIQUE INDEX fib_ix ON fib(pos);
INSERT INTO fib VALUES (1,1);
INSERT INTO fib VALUES (2,1);
INSERT INTO fib VALUES (3,NULL);
INSERT INTO fib VALUES (4,NULL);
INSERT INTO fib VALUES (5,NULL);
INSERT INTO fib VALUES (6,NULL);
INSERT INTO fib VALUES (7,NULL);
INSERT INTO fib VALUES (8,NULL);
INSERT INTO fib VALUES (9,NULL);
INSERT INTO fib VALUES (10,NULL);
INSERT INTO fib VALUES (11,NULL);
INSERT INTO fib VALUES (12,NULL);
INSERT INTO fib VALUES (13,NULL);
INSERT INTO fib VALUES (14,NULL);
INSERT INTO fib VALUES (15,NULL);
INSERT INTO fib VALUES (16,NULL);
INSERT INTO fib VALUES (17,NULL);
INSERT INTO fib VALUES (18,NULL);
INSERT INTO fib VALUES (19,NULL);
INSERT INTO fib VALUES (20,NULL);
UPDATE fib SET -- compute fibonacci numbers
val =  (SELECT h1.val FROM fib as h1 where pos = fib.pos - 1) +
   (SELECT h2.val FROM fib as h2 where pos = fib.pos - 2)
WHERE pos > 2;

select * from fib; -- show the results



-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm



[sqlite] SQLite is Awesome

2005-10-12 Thread Chris Gurtler
Hi,

Ok, so Mr. Hipp's spelling may need a little work, but SQLite has got to be the 
best bit of software that I have come accross for quite a while.

Thank you !!


Regards,

Chris







Re: [sqlite] help needed with syntax error in between.test script

2005-10-12 Thread Jacob Dall

It's the latect Tcl version - 8.4.11

/jacob

At 23:46 11/10/2005, you wrote:

Jacob Dall <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I've just managed to get SQLite v3.2.7 compiled and installed on a
> QNX platform.
>
> When executing the test suite (make test) I'm notified of an error in
> the between-1.0 test. The message is:
>
> Error: syntax error in expression "int(log($i)/log(2))": extra tokens
> at end of expression
>

What version of Tcl are you linking against?
--
D. Richard Hipp <[EMAIL PROTECTED]>


---
EURISCO
Forskerparken 10
DK-5230 Odense M
Tlf. 63 15 71 00
www.eurisco.dk
---