Re: [sqlite] Sparse matrix

2007-08-22 Thread T
Hi Darren, It seems to me that you have a flawed design. Displaying sparse like that should be a function of your application display code, not the database I had to chuckle that when I asked "How do I use this to do that", your solution was "you shouldn't have that and you should do it

Re: [sqlite] Sparse matrix

2007-08-22 Thread T
Hi Simon, Here's a less gruesome version - no cases. I've given no thought to performance comparisons. Thanks for the two great solutions you posted. They certainly achieve the desired result with the simplified sample I gave. However, in the broader reality, it doesn't quite satisfy my

[sqlite] _ROWID_ internal column, versus explicit INTEGER PRIMARY KEY with VACUUM

2007-08-22 Thread Andrew Finkenstadt
I realize that FTS1/2 has this slight flaw with the text indexes recording the _rowid_ of a table, in the expectation that a rowid was permanent. That would have caught me unawares, as in Oracle a ROWID is permanent... even if the row has migrated, there's a migrate record at the place where the

RE: [sqlite] executing sql on a sqlite from the cmd line

2007-08-22 Thread Gauthier, Dave
I also discovered that I can just use the "-header" and "-column" qualifiers before specifying the DB name. And, apparently, you can even epscify the init file with "-init".(foolish me, I was looking for this type of info before using "-h".. not "-help"). -dave -Original Message-

[sqlite] sqlite.init ???

2007-08-22 Thread Gauthier, Dave
Hi: I found nothing on the official sqlite website (sqlite.org) regarding the sqlite.init file. Did I miss something? Are there other (better) documentation resources other than the documentation link on sqlite.org? SPecifically, I'm trying to either point sqlite3 to a specific sqlite.init

RE: [sqlite] executing sql on a sqlite from the cmd line

2007-08-22 Thread Joe Wilson
--- "Gauthier, Dave" <[EMAIL PROTECTED]> wrote: > But how can I ".mode column" and ".header on" as well as run the query If you're using bash (ksh and sh might work as well): $ echo -e ".header on\n.mode column\nselect * from sqlite_master;" | ./sqlite3 abc.db typenametbl_name

RE: [sqlite] executing sql on a sqlite from the cmd line

2007-08-22 Thread Gauthier, Dave
Yes, the sql works. (Thanks James) But how can I ".mode column" and ".header on" as well as run the query (given that I'm developing this for others to use and don't want to make them create/edit a ~/sqlite.init with those elements) -dave -Original Message- From: James Dennett

Re: [sqlite] executing sql on a sqlite from the cmd line

2007-08-22 Thread Rich Shepard
On Wed, 22 Aug 2007, Gauthier, Dave wrote: On Linux... How can I execute a sql command against a sqlite DB straight from the command line. Somethign like sqlite3 foo.sqldb -e "select * from mytable" or... sqlite3 foo.sqldb < "select * from mytable" Dave, Write a script. If

[sqlite] executing sql on a sqlite from the cmd line

2007-08-22 Thread Gauthier, Dave
On Linux... How can I execute a sql command against a sqlite DB straight from the command line. Somethign like sqlite3 foo.sqldb -e "select * from mytable" or... sqlite3 foo.sqldb < "select * from mytable" (only these don't work) Also, can I prefix with a setup option

Re: [sqlite] Sparse matrix

2007-08-22 Thread Simon Davies
Hi Tom, Here's a less gruesome version - no cases. I've given no thought to performance comparisons. C:\Joinerysoft\JMS\dev\trunk> sqlite3 tst.db SQLite version 3.4.0 Enter ".help" for instructions sqlite> insert into List values( 'a' ); sqlite> insert into List values( 'a' ); sqlite> insert

[sqlite] Feedback: Enabling FTS2 in Python + .net or anything else

2007-08-22 Thread Andre du Plessis
Ok this is how I got the fts working in python and .net... In python 2.5 sqlite3 is automatically included as a builtin. However I could not find any method which loads the extention or to enable it, I COULD do it in SQL by using: conn.cursor().execute("SELECT load_extension('fts2')")

Re: [sqlite] Sparse matrix

2007-08-22 Thread Simon Davies
Hi Tom, Its a pretty gruesome bit of sql... C:\Joinerysoft\JMS\dev\trunk> sqlite3 tst.db SQLite version 3.4.0 Enter ".help" for instructions sqlite> create table List( Code text ); sqlite> insert into List values( 'a' ); sqlite> insert into List values( 'a' ); sqlite> insert into List values(

Re: [sqlite] bigfile test

2007-08-22 Thread J Jayavasanthan
More on to my earlier email, I believe SQLite already uses those flags, I haven't done the testing myself, but it is claimed SQLite is able to create rather large databases (in terms of TBs) without any fuss, Regards, Jayavasanthan J On 8/22/07, J Jayavasanthan <[EMAIL PROTECTED]> wrote: > > Hi

Re: [sqlite] bigfile test

2007-08-22 Thread J Jayavasanthan
Hi Victor, Normally the large file creation should not fail on the 32 bit builds. And -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 will create other side effects such as off_t getting to long long rather than long and similar with size_t (I guess). The solution is to access/create the file along

Re: [sqlite] Sparse matrix

2007-08-22 Thread Darren Duncan
It seems to me that you have a flawed design. You should just have a 2 column database to begin with, with a table like this: Code Count a 4 b 2 c 3 Rather than plain inserting or deleting rows, just sometimes insert or delete, you should instead increment or decrement