Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Igor Tandetnik
Allen Fowler wrote: > # Show all events and duration: > sqlite> select *, (strftime('%s', end) - strftime('%s', start)) as > length from events; > idname kind > start end length >

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Sat, Jun 13, 2009 at 01:43:15AM +0100, Dr. David Kirkby wrote: > Thank you for your help. The fact you told me I did not need to link > libpthread was crucial to solving this. > > I've found that just removing the libpthread from the generated Makefile > solves this. Glad to help. > The

Re: [sqlite] sqlite3_step performance degredation

2009-06-12 Thread Nuno Lucas
On Sat, Jun 13, 2009 at 1:52 AM, Mike Borland wrote: > I have a fairly complex program where I am seeing a performance > degradation of the sqlite3_step() function.  Basically I'm iterating > roughly 200 rows at a time, over and over.  The only work happening > during

Re: [sqlite] sqlite3_step performance degredation

2009-06-12 Thread Mike Borland
Simon, Thanks for the reply! I have read that documentation and everything else that google search would bring up on the site. Memory is constant. When you ask about "disposing of the result of one step before proceeding to the next", what exactly do you mean? Can't I theoretically call

Re: [sqlite] SQL error: disk I/O error

2009-06-12 Thread pierr
Nuno Lucas-2 wrote: > > On 5/23/07, Shilpa Sheoran wrote: >> Linux 2.6.9 >> and the media is Nand Flash memory. >> /dir1/dir2/dir3 >> >> /dir1/dir2 is readonly (cramfs) >> dir3 is read write (Flash mem). and I'm creating the database in dir3. > > There is your

Re: [sqlite] sqlite3_step performance degredation

2009-06-12 Thread Simon Slavin
On 13 Jun 2009, at 1:52am, Mike Borland wrote: > I have a fairly complex program where I am seeing a performance > degradation of the sqlite3_step() function. Basically I'm iterating > roughly 200 rows at a time, over and over. The only work happening > during the iteration is I'm copying the

[sqlite] sqlite3_step performance degredation

2009-06-12 Thread Mike Borland
Hi all! I have a fairly complex program where I am seeing a performance degradation of the sqlite3_step() function. Basically I'm iterating roughly 200 rows at a time, over and over. The only work happening during the iteration is I'm copying the record into an array. At first, sqlite3_step()

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
Nicolas Williams wrote: > On Fri, Jun 12, 2009 at 04:34:50PM -0500, Nicolas Williams wrote: >> On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: >>> [...] >>> -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 >>> >>> If the order of libpthread and libc

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Allen Fowler wrote: > Indeed, I am aware that SQL is not a "traditional" programming language > per-se and have will now be writing the calendar logic at the application > level. (Looking at Python...) You may want to get a good understanding of

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread John Machin
On 13/06/2009 9:05 AM, Allen Fowler wrote: > Indeed, I am aware that SQL is not a "traditional" > programming language per-se and have will now be writing > the calendar logic at the application level. (Looking at Python...) Don't look any further :-) Check out the dateutil module...

Re: [sqlite] repeating events?

2009-06-12 Thread John Machin
On 13/06/2009 1:08 AM, Allen Fowler wrote: >> What are you doing about timezones and DST? Are "start" and "end" UTC? > > For v1, all local times. UTC is not a requirement yet, but if can be added > with out hassle, then why not. > >> Is a location (and by extension a timezone) associated

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Fri, Jun 12, 2009 at 11:46:01PM +0100, Dr. David Kirkby wrote: > > I spoke to a Solaris linker engineer, and we both suspect that: a) > > you're using gld, > > Yes, I am. > > GNU ld version 2.15 > > [...] > > I can try it with Solaris ld. OK, let us know how that goes. Also, if there's

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Allen Fowler
> Simon Slavin wrote: > > > I'm not sure you appreciate what Roger (please be more careful about > your quoting, by the way) is telling you. SQL is not a programming > language. It's a way of accessing a database. The two are not at all > equivalent: everything you can do in SQL you

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
Nicolas Williams wrote: > On Fri, Jun 12, 2009 at 04:34:50PM -0500, Nicolas Williams wrote: >> On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: >>> [...] >>> -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 >>> >>> If the order of libpthread and libc

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Simon Slavin
On 12 Jun 2009, at 11:14pm, Allen Fowler wrote: >> You'll probably find it easier to write the processing algorithm in >> the >> programming language of your choice. This will allow you to print >> out >> diagnostics as you go along, play with a debugger etc. To make it >> easy >> to map

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
Nicolas Williams wrote: > On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: >> [...] >> -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 >> >> If the order of libpthread and libc are exchanged, the library can be >> built. In other words, libc needs to

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Allen Fowler
> > > > What am I missing here? Am I doing the query wrong? > > Yes. The "group by" doesn't know which rows to use for columns that > are not either aggregate functions (such as min) or grouped columns > (such as name). You know what min() does, but the query processor > doesn't. >

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Fri, Jun 12, 2009 at 04:34:50PM -0500, Nicolas Williams wrote: > On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: > > [...] > > -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 > > > > If the order of libpthread and libc are exchanged, the library

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Allen Fowler
> > I'd recommend continuing down the path you are exploring which is having > test data and tweaking/tuning/correcting your queries until they are > acceptable. > > You'll probably find it easier to write the processing algorithm in the > programming language of your choice. This will

Re: [sqlite] sql query with sqlite3_exec

2009-06-12 Thread sql_newbie
Thanks very much. The link was very useful, and now it is clear to me how basiclly to use sqlite3 C++ API. =) Kees Nuyt wrote: > > On Fri, 12 Jun 2009 07:05:36 -0700 (PDT), sql_newbie > > > http://www.sqlite.org/cvstrac/wiki?p=SimpleCode > -- View this message in context:

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Nicolas Williams
On Fri, Jun 12, 2009 at 10:06:31PM +0100, Dr. David Kirkby wrote: > [...] > -lpthread -lc -Wl,-soname -Wl,libsqlite3.so.0 -o .libs/libsqlite3.so.0.8.6 > > If the order of libpthread and libc are exchanged, the library can be > built. In other words, libc needs to be linked before libpthread,

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
Dr. David Kirkby wrote: > Dr. David Kirkby wrote: >> Dr. David Kirkby wrote: > > >> >> I just tried to build libtool 1.5.24 (the version of libtool used in >> the latest sqlite release, and noticed that: >> >> 4 of 107 tests failed >> (5 tests were not run) I just realised i done a stupid

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Doug Currie
On Jun 12, 2009, at 3:46 PM, Allen Fowler wrote: > sqlite> > select *, min((strftime('%s', end) - strftime('%s', start))) as > length > from > ...> events where > ...> start < datetime('now', '+1 day','start of day', > '+9 hours','+30 minutes') > ...> and end > datetime('now', '+1

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
Dr. David Kirkby wrote: > Dr. David Kirkby wrote: > > I just tried to build libtool 1.5.24 (the version of libtool used in the > latest sqlite release, and noticed that: > > 4 of 107 tests failed > (5 tests were not run) > Please report to bug-libt...@gnu.org > Yes, there are definite issues

Re: [sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Allen Fowler wrote: > What am I missing here? Am I doing the query wrong? It would take a considerable number of iterations to help get the queries exactly correct, especially as there are lots of details as you note such as sort order etc :-) I'd

[sqlite] Shortest time interval? [Was: Re: repeating events?]

2009-06-12 Thread Allen Fowler
> > You could be storing event duration, not stop time. Or perhaps store > both. > Here is what I have so far: sqlite> create table events (id INTEGER PRIMARY KEY AUTOINCREMENT, name, kind, start, end); # Now add some events for "tomorrow" sqlite> insert into events values (null,

Re: [sqlite] sql query with sqlite3_exec

2009-06-12 Thread Kees Nuyt
On Fri, 12 Jun 2009 07:05:36 -0700 (PDT), sql_newbie wrote: > >I have another question about sqlite3_exec : > >How can i interact with the database and save the result in a C string for >forther use. For example: > >sqlite3_exec( db, "SELECT FROM urls", NULL, NULL, ); > >How

[sqlite] Query regarding downloading 3.2.2 version of Sqlite

2009-06-12 Thread ganesh hegde
Hey PPL, i am required to use 3.2.2 version of sqlite as part of my work, because that is the version that has been approved. So could anyone please let me know if there is any way of downloading the 3.2.2 version of the binaries for Windows.(The current download page only points to 3.6.14).

Re: [sqlite] repeating events?

2009-06-12 Thread Simon Slavin
On 12 Jun 2009, at 4:08pm, Allen Fowler wrote: > If you have any suggestions for how start planning for multiple TZ > and UTC / DST support, I would be very interested to hear. All date data should be stored as UTC. It is extremely difficult to get this right later if you don't start off

[sqlite] Hi

2009-06-12 Thread AHmet Mehmet
Hi ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] repeating events?

2009-06-12 Thread Allen Fowler
> What are you doing about timezones and DST? Are "start" and "end" UTC? > For v1, all local times. UTC is not a requirement yet, but if can be added with out hassle, then why not. > Is a location (and by extension a timezone) associated with events like > face-to-face meetings? >

Re: [sqlite] sql query with sqlite3_exec

2009-06-12 Thread sql_newbie
I have another question about sqlite3_exec : How can i interact with the database and save the result in a C string for forther use. For example: sqlite3_exec( db, "SELECT FROM urls", NULL, NULL, ); How can i save the returned result-table in a C string for further use in the program?

[sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-12 Thread Oza, Hiral_Dineshbhai
Hi, I am using sqlite-3.5.9 and observing a 'disk image malformed' error after executing several sql statements on nfs after running 'PRAGMA integrity_check' got following messages... SQLite version 3.5.9 Enter ".help" for instructions sqlite> PRAGMA integrity_check; *** in database main ***

[sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-12 Thread Oza, Hiral_Dineshbhai
Hi, I am using sqlite-3.5.9 and observing a 'disk image malformed' error after executing several sql statements on nfs after running 'PRAGMA integrity_check' got following messages... SQLite version 3.5.9 Enter ".help" for instructions sqlite> PRAGMA integrity_check; *** in database main ***

Re: [sqlite] repeating events?

2009-06-12 Thread John Machin
On 12/06/2009 7:48 PM, Allen Fowler wrote: > idname kind start > end length > > -- > 3

Re: [sqlite] repeating events?

2009-06-12 Thread Allen Fowler
> > One table of the events with fields you need (eg description, start and > end, repeating rule). A second table with the exceptions, or depending > on how much you want to normalize a table per exception type. > > > Where is this calculation being done? In SQL? At the app level? How?

[sqlite] help , testing problem

2009-06-12 Thread ???
Hello, I just have a project based on SQLite, and for some reasons, I have to change source code of SQLite. So I have to verify the changed code. I wish TCL Tests can be used to the work, but I don't know how to compile a test dll of SQLite in windows. How can I do it . thanks, :)

Re: [sqlite] defrag a numeric field

2009-06-12 Thread Simon Slavin
On 12 Jun 2009, at 8:54am, galea...@korg.it wrote: > I've got an int column containing a numeric sequence like > 1,5,6,8,10... how can I perform an update in order to have 1,2,3,4,5? In software. Not by just using one SQL command. The simplest repeatable way to do it in SQLite would be to

Re: [sqlite] repeating events?

2009-06-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >>> 1) How should I be structuring the DB so to store this data sanely. >> The above is the easiest way if you want to do imports and exports. >> > > I'm not sure what you mean Unless your system is going to operate in total isolation from

[sqlite] defrag a numeric field

2009-06-12 Thread galeazzi
Hi, I've got an int column containing a numeric sequence like 1,5,6,8,10... how can I perform an update in order to have 1,2,3,4,5? Thanks ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
i thought I'd copy the output of the config.log too. The message size limit of 40 KB was exceeded when I tried it in a previous attempt to submit this, so hopefully this will be ok. kir...@t2:~/sqlite-3.6.14.2$ more config.log This file contains any messages produced by compilers while

[sqlite] Build problem of sqlite-3.6.14.2 on Solaris 10 with gcc 4.4.0

2009-06-12 Thread Dr. David Kirkby
I'm sending this to sqlite-users@sqlite.org in the hope someone can help, but are copying it to sage-de...@googlegroups.com so there is a record there. I'll post a summary to the latter list later. I'm helping out on the GPL'ed open-source mathematics program Sage http://www.sagemath.org/ to

Re: [sqlite] repeating events?

2009-06-12 Thread Allen Fowler
> > I'm looking for suggestions on how to store and retrieve events for a > > calendering system in SQlite. > > > > For each user there must be: > > > > 1) All day events on a specific day. > > 2) All day events that are repeated over a given date range. > > 3) All day events that are repeat