[sqlite] SQL Quick Review/Reference

2008-04-11 Thread Amit Uttamchandani
Hey everyone, Just got back into the world of SQL after being away for 5 years. This time I decided to jump in with SQLite. It really has me excited. Anyways, I have done a lot database work but I seem to have forgotten a lot of the subtleties of database designs/schema. I am wondering if any

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Aladdin Lampé
Phil, In order to disable totally journaling, I think (to be confirmed by real sqlite experts though) that you could patch each 4 calls to the function: int sqlite3BtreeFactory(const sqlite3 *db, const char *zFilename, int omitJournal, int nCache, int flags, Btree **ppBtree); using always

Re: [sqlite] schema design question

2008-04-11 Thread Jeff Gibson
Thanks for all the suggestions. My schema is now a lot cleaner, and my application runs 30% faster! Jeff Richard Klein wrote: >> Jeff Gibson wrote: >> >>> One thing your earlier suggestion brought up. The way I was hooking up >>> tables before was something along the lines of: >>>

[sqlite] Website typo

2008-04-11 Thread Richard Klein
The web page http://www.sqlite.org/compile.html contains the following typo: SQLITE_OMIT_TRIGGER Defining this option omits support for VIEW objects... It should read: ... omits support for TRIGGER objects... - Richard ___ sqlite-users mailing list

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Ken
Phil, Yes its complicated. Yes its doable! But if you want performance its going to be a bit complicated. Sqlite does not allow concurrent read/write even from multiple threads! Step back a bit, I've answered the question: yes you may disable journalling. But the real problem your having is

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Phil Sherrod
Holding commits with a timeout is a feasible solution. However, in my application it is somewhat complex to implement. Multiple threads are accessing the database, and read requests usually run in a different thread than writes. I don't want reads to be blocked while a commit timeout waits, so

Re: [sqlite] List Columns

2008-04-11 Thread Dennis Cote
Fred J. Stephens wrote: > Is there a way to list the column names in a table from the SQLite > command line interface? I know .schema will show them, but the > output seems like it would be difficult to parse so that only the column > names are shown. > See pragma table_info(table-name) at

Re: [sqlite] error in sqlite3_extension_init

2008-04-11 Thread Dennis Cote
dark0s dark0s wrote: > But I don't understand where is the error in row below: > > int sqlite3_extension_init(sqlite3 *db, char **pzErrMsg, const > sqlite3_api_rountines *pApi) { > This is one of those groaners. :-) Compare these two lines. sqlite3_api_routines sqlite3_api_rountines

[sqlite] List Columns

2008-04-11 Thread Fred J. Stephens
Is there a way to list the column names in a table from the SQLite command line interface? I know .schema will show them, but the output seems like it would be difficult to parse so that only the column names are shown. Thanks Fred Stephens ___

Re: [sqlite] schema design question

2008-04-11 Thread Richard Klein
Jay A. Kreibich wrote: > On Thu, Apr 10, 2008 at 05:58:59PM -0700, Richard Klein scratched on the wall: > >> My advice would be to try it and see. If table creation takes too long, >> you can always remove the UNIQUE constraint, and then write a routine to >> check the table for uniqueness after

Re: [sqlite] schema design question

2008-04-11 Thread Richard Klein
> Jeff Gibson wrote: >> One thing your earlier suggestion brought up. The way I was hooking up >> tables before was something along the lines of: >> >> CREATE TABLE primary(id1 INTEGER PRIMARY KEY, ); >> CREATE TABLE secondary(id2 INTEGER PRIMARY KEY, ); >> CREATE TABLE link(id1 INTEGER, id2

Re: [sqlite] reading MS Access 97 files

2008-04-11 Thread John Grant
Many thanks, Fred. -John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fred J. Stephens Sent: Thursday, April 10, 2008 7:36 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] reading MS Access 97 files Rich Shepard wrote: > On Thu, 10

[sqlite] error in sqlite3_extension_init

2008-04-11 Thread dark0s dark0s
But I don't understand where is the error in row below: int sqlite3_extension_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_rountines *pApi) { Can some suggest me something? - #include #include #include #include SQLITE_EXTENSION_INIT1 void

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread RB Smissaert
DRH, I would be seriously interested in a PRAGMA to disable/avoid a journal file as in my application I don't need it at all and it only slows down my DB writes. Would it be possible to add this? If so, thanks in advance. RBS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Ken
Yes the OS buffers, my error.. My point was that a close happens when sqlite commits. Which means that the OS will attempt to write the buffers to disk and in all likely hood some of the buffers will make it to disk this is I/O. Then the file is deleted aka commit! Regards, Ken "Jay A.

Re: [sqlite] error in sqlite3_extension_init

2008-04-11 Thread Dan
On Apr 12, 2008, at 12:36 AM, dark0s dark0s wrote: > Excuse me for my stupid topic, but I am crazying to find error in > program below. > > My output is: > > bash-3.1# gcc -shared labsinf.c -o inf.so > labsinf.c:61: error: expected ';', ',' or ')' before '*' token > > The errror is for

[sqlite] error in sqlite3_extension_init

2008-04-11 Thread dark0s dark0s
Excuse me for my stupid topic, but I am crazying to find error in program below. My output is: bash-3.1# gcc -shared labsinf.c -o inf.so labsinf.c:61: error: expected ';', ',' or ')' before '*' token The errror is for sqlit3_extension_init row, but I don't see strange things #include #include

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Jay A. Kreibich
On Fri, Apr 11, 2008 at 09:08:04AM -0700, Ken scratched on the wall: > Even with Synchronous = off > > Sqlite will flush its buffers upon the commit! I'm not talking about SQLite's buffers, I'm talking about the file-system driver of the operating system. > As a "close" system call is

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Ken
Even with Synchronous = off Sqlite will flush its buffers upon the commit! As a "close" system call is performed! The next step is to Delete the file. :) (the commit point). "Jay A. Kreibich" <[EMAIL PROTECTED]> wrote: On Fri, Apr 11, 2008 at 03:28:47PM +0200, Martin Engelschalk

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Ken
Phil, Removing the journalling will certainly cause you lots of grief in the event of a "crash"... You could do the following, The write code (inserts) will queue incoming data into an "array/storage in memory etc..." When the first row is captured set a timer. When

Re: [sqlite] cannot open shared file object: no such file or directory

2008-04-11 Thread Ken
Run sqlite3> select load_extension('YOUR FULL PATH HERE/half.so'); dark0s dark0s <[EMAIL PROTECTED]> wrote: Ok, I build sqlite3 with load extension support, now I must execute extension: #gcc -shared half.c -o half.so #export LD_LIBRARY_PATH='pwd' #sqlite3 sqlite>.load half.so half.so: cannot

Re: [sqlite] schema design question

2008-04-11 Thread Dennis Cote
Jeff Gibson wrote: > > One thing your earlier suggestion brought up. The way I was hooking up > tables before was something along the lines of: > > CREATE TABLE primary(id1 INTEGER PRIMARY KEY, ); > CREATE TABLE secondary(id2 INTEGER PRIMARY KEY, ); > CREATE TABLE link(id1 INTEGER, id2

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Jay A. Kreibich
On Fri, Apr 11, 2008 at 03:28:47PM +0200, Martin Engelschalk scratched on the wall: > Hello Donald, > > I don't think so: The journal files are not synchronized on SYNCHRONOUS > = OFF, but they are still written, so transactions are still possible. Yes, but if I understand the

Re: [sqlite] [noob] merge statement equivalent?

2008-04-11 Thread Jay A. Kreibich
On Thu, Apr 10, 2008 at 09:02:39PM +0200, Petite Abeille scratched on the wall: > Hello, > > How does one emulate a DML MERGE statement in SQLite [1]? > > INSERT OR REPLACE sounds promising but the REPLACE documentation under > the ON CONFLICT clause seems to imply that in the case of a

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Griggs, Donald
Yes, transactions are not disabled, you're right. But would not setting SYNCHRONOUS off not give you about the same factor of 20 improvement as your removal of FlushFileBuffers -- without requiring a source change? As to what further speedup might result from truly disabling transactions, you

Re: [sqlite] Sqlite question---->how to impose order on query

2008-04-11 Thread Jay A. Kreibich
On Thu, Apr 10, 2008 at 09:56:31PM -0500, Dewey Gaedcke scratched on the wall: > Set @a = 0; > Select T1.rownumber, T1.Col2 from > ( > Select @a:[EMAIL PROTECTED] as rownumber, Col1, Col2 > from Table where Col1 = 'abc' Order by Col1 > ) as T1 > Where T1.rownumber between

Re: [sqlite] schema design question

2008-04-11 Thread Jay A. Kreibich
On Thu, Apr 10, 2008 at 05:58:59PM -0700, Richard Klein scratched on the wall: > My advice would be to try it and see. If table creation takes too long, > you can always remove the UNIQUE constraint, and then write a routine to > check the table for uniqueness after it's created. That

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Martin Engelschalk
Hello Donald, I don't think so: The journal files are not synchronized on SYNCHRONOUS = OFF, but they are still written, so transactions are still possible. Martin Griggs, Donald wrote: > Regarding: " removing the call of FlushFileBuffers for each transaction > made my application run 20

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Griggs, Donald
Regarding: " removing the call of FlushFileBuffers for each transaction made my application run 20 times faster." Since you don't need the integrity protection that transactions afford, would you not get the same performance gain using the standard source and setting SYNCHRONOUS to zero? This

[sqlite] Searching for patterns using patterns

2008-04-11 Thread Hien Le
Dear all, I would like to find all the rows in two text columns that share a common pattern. I can do this with Perl or Ruby using variables and regular expressions, but I am curious to know if there is a way to do it just using SQL. For example, I wish to find entries that match 'foo', but

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Phil Sherrod
> Do you know that the performance without doing anything special is unacceptable? If I do insertions of a test set of 2000 records using a BEGIN TRANSACTION/COMMIT around each one, the speed is 20 times slower than doing additions in a single transaction. I hacked the winSync routine and

Re: [sqlite] Security for SQLite

2008-04-11 Thread P Kishor
On 4/11/08, Ulrik Sandborg-Petersen <[EMAIL PROTECTED]> wrote: > Hi Gerald, > > Gerald Johnson wrote > > > I have a CD application that a vendor is suggesting that I use SQLite as > > the db. My concern is security. Currently we are using Access which is > > password protected, but very slow.

Re: [sqlite] Security for SQLite

2008-04-11 Thread Ulrik Sandborg-Petersen
Hi Gerald, Gerald Johnson wrote > I have a CD application that a vendor is suggesting that I use SQLite as > the db. My concern is security. Currently we are using Access which is > password protected, but very slow. I have not found any information > about having SQLite password protected.

Re: [sqlite] Security for SQLite

2008-04-11 Thread Ulrich Telle
Hi Gerald, > I have a CD application that a vendor is suggesting that I use SQLite as > the db. My concern is security. Currently we are using Access which is > password protected, but very slow. I have not found any information > about having SQLite password protected. Is it possible, and I

Re: [sqlite] reading MS Access 97 files

2008-04-11 Thread Michael Ruck
Even though I haven't done anything with this stuff for almost 6 years, I haven't forgotten this stuff. But I intentionally left out a couple of short lived technologies... :( Mike -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Fred J. Stephens

Re: [sqlite] reading MS Access 97 files

2008-04-11 Thread ajm
Perhaps this URL can help you http://www.allbusiness.com/technology/software-services-applications-programming/5893603-1.html Good luck, and greetings Adolfo. -Original Message- From: John Grant [mailto:[EMAIL PROTECTED] Sent: Thursday, April 10, 2008 05:59 PM To: 'General Discussion

Re: [sqlite] cannot open shared file object: no such file or directory

2008-04-11 Thread Didier Spaier
I suggest you read this : http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html may-be it can help. Reminder : doing ordinary things as root is dangerous. Regards, Didier Le Friday 11 April 2008 07:36:52 dark0s dark0s, vous avez écrit : > Ok, I build sqlite3 with load extension

Re: [sqlite] Any way to disable journaling & rollback?

2008-04-11 Thread Martin Engelschalk
Hi all, i have the same requirements. I don't need transactions at all and do not care if my databases become corrupt. However, i follow the versions of sqlite and do not want to change the code. Perhaps it is an idea to add something like "paragma disable_transactions" some time in the future?