Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
Checking for NULL on the statement fixed it :) -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Roger Binns Sent: Friday, April 09, 2010 5:43 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite parsing of

[sqlite] Index and GLOB

2010-04-09 Thread Mike Goins
First thanks to all that have helped on previous occasions. I'm a little confused about some results using an index and GLOB. I'm trying to optimize some queries to ensure they use an index after reviewing the LIKE Optimization section at the sqlite website. Using the latest binary,

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
So, using the tail pointer from sqlite3_prepare_v2() I'm now running through a loop to process all statements in a file. I'm presently using pointer math in order to determine the length of the tail command since no length value is returned as part of the function. I'm running into a nasty

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
Ah, I missed that in the documentation. This is perfect! Precisely what I needed with much less work than copying the shell.c code. Thanks a bunch! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dan Kennedy Sent: Friday,

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Roger Binns
On 04/09/2010 11:13 AM, Shaun Seckman (Firaxis) wrote: > What is the best way to ensure that all commands are executed? Load the whole file into memory or memory map it. Then call sqlite3_prepare/step/reset. prepare will point you to the beginning of the next statement if there is one. > The

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
Ah, I believe it is something that the command line tool can .read. Since I'm using just the static library, I'll have to copy the functionality from shell.c into my own code. Thanks! -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Dan Kennedy
On Apr 10, 2010, at 1:51 AM, Adam DeVita wrote: > Is this a 1 off import? If so, perhaps the command line tool > can .read it. > > On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < > shaun.seck...@firaxis.com> wrote: > >> Greetings, >> >> I've got a .SQL file that contains multiple

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Adam DeVita
Is this a 1 off import? If so, perhaps the command line tool can .read it. On Fri, Apr 9, 2010 at 2:13 PM, Shaun Seckman (Firaxis) < shaun.seck...@firaxis.com> wrote: > Greetings, > > I've got a .SQL file that contains multiple SQL insert statements for > various tables as well as comments

[sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Shaun Seckman (Firaxis)
Greetings, I've got a .SQL file that contains multiple SQL insert statements for various tables as well as comments embedded throughout. When I attempted to pass the file into sqlite3_exec, I found that only the first SQL command was getting executed. What is the best way to ensure that all

Re: [sqlite] Poor query planning for virtual tables

2010-04-09 Thread Alexey Pechnikov
Hello! On Friday 09 April 2010 18:27:52 Roger Binns wrote: > > Virtual table _doesn't_ use any index but query planner show this: > > 0|2|TABLE role_fts VIRTUAL TABLE INDEX 0: > > It is showing the results of the BestIndex virtual table method. Thanks. So the problem is in the FTS3 extension

Re: [sqlite] Poor query planning for virtual tables

2010-04-09 Thread Roger Binns
On 04/09/2010 12:27 AM, Alexey Pechnikov wrote: > Virtual table _doesn't_ use any index but query planner show this: > 0|2|TABLE role_fts VIRTUAL TABLE INDEX 0: It is showing the results of the BestIndex virtual table method. Roger ___ sqlite-users

Re: [sqlite] Export sqlite database to H2

2010-04-09 Thread Vivien Malerba
On 9 April 2010 13:37, Andreas Henningsson wrote: > Hi > > I am about to change database from SQLite to H2 in a project of mine. > > Is there any tools I can use to do i it? What is the best way to export data > from an SQLite database? > The easiest is probably

Re: [sqlite] sqlite3_step() transaction

2010-04-09 Thread Simon Slavin
On 9 Apr 2010, at 11:57am, Igor Tandetnik wrote: > Christoph Walser, ETH Zurich wrote: >> Is there a way to do all the 5000 rows in one transaction to minimize >> database locking time? I know I can do a sqlite3_exec with "BEGIN >> TRANSACTION", then do the inserts and then "COMMIT TRANSACTIONS"

Re: [sqlite] Export sqlite database to H2

2010-04-09 Thread Andreas Henningsson
H2 is a java bases database. I have just started to use it and it works quite well. It have the datatypes you expect and a very natural SQL language. Mips, I do not know. It's open source I think. The only reason I use it is because I want to have the possibility to store files in the database.

Re: [sqlite] Export sqlite database to H2

2010-04-09 Thread Navaneeth Sen B
Hi Andreas, I have some questions. Can H2 completely replace SQLite? I would like to know more about H2. Does that have a port on Linux-MIPS platform? Does it have any licensing issues?(whether open source) Can it perform better than SQLite? Or what made you move to H2 from SQLite? Regards, Sen

[sqlite] Export sqlite database to H2

2010-04-09 Thread Andreas Henningsson
Hi I am about to change database from SQLite to H2 in a project of mine. Is there any tools I can use to do i it? What is the best way to export data from an SQLite database? /Andreas -- Andreas Henningsson "Vanligt sunt förnuft är inte särkilt vanligt." -- Voltaire

Re: [sqlite] sqlite3_step() transaction

2010-04-09 Thread Igor Tandetnik
Christoph Walser, ETH Zurich wrote: > I have a C application which generates around 1000 rows of data per > second to insert in an SQLite database. > What I now do is to collect 5000 rows in a buffer and then for each row, > execute sqlite3_bind_*, sqlite3_step, sqlite3_reset. > > I wonder now

[sqlite] problem porting sqlite amalgamation 3.6.23.1 to vxworks 6.5 pentium3 DKM

2010-04-09 Thread zhenhuan du
I created a vxworks 6.5 Pentium3 downloadable kernel module project . Sqlite3.c and sqlite3.h were imported into project. But when I compiled the sqlite3.c I got the following error output. I wonder whether this package can be directly put into use without any problem with vxworks 6.5. Hope

[sqlite] problem porting sqlite amalgamation 3.6.23.1 to vxworks 6.5 DKM

2010-04-09 Thread zhenhuan du
I created a downloadable kernel module project . Sqlite3.c and sqlite3.h were imported into project. But when I compiled the sqlite3.c I got the following error output. I wonder whether this package can be directly put into use without any problem with vxworks 6.5. Hope someone can help me

Re: [sqlite] Poor query planning for virtual tables

2010-04-09 Thread Alexey Pechnikov
Hello! On Friday 09 April 2010 01:28:18 Jay A. Kreibich wrote: > Exactly like every other query the database makes? Why would > this be different? Virtual table _doesn't_ use any index but query planner show this: 0|2|TABLE role_fts VIRTUAL TABLE INDEX 0: Why planner don't show full-teable

[sqlite] sqlite3_step() transaction

2010-04-09 Thread Christoph Walser, ETH Zurich
Hi everybody, I have a C application which generates around 1000 rows of data per second to insert in an SQLite database. What I now do is to collect 5000 rows in a buffer and then for each row, execute sqlite3_bind_*, sqlite3_step, sqlite3_reset. I wonder now how sqlite does this internaly: