[sqlite] FTS3 can not support double-quote character search.

2011-01-26 Thread Andy
An unmatched double-quote the right-hand argument to MATCH causes an error in FTS3. Example: CREATE VIRTUAL TABLE t1 USING fts3(x); INSERT INTO t1 VALUES('abc"def"123'); SELECT * FROM t1 WHERE t1 MATCH '"*'; The SELECT statement above returns: "malformed MATCH expression: ["*]. Can this feature

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
FYI, I finally figured out why it is slow with C because I need to turn off autocommit, it is now lightning speed :) Thanks, Bella ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
> Parameters are numbered from 1, not from 0. Your first sqlite3_bind_int > call fails; the second binds a value for function_id column; the > parameter for function_name retains its initial value of NULL. The > insert then runs afoul of NOT NULL constraint. Ah, that fixed it. Thanks much.

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Igor Tandetnik
On 1/26/2011 7:48 PM, Bella Chan wrote: > I got "19 constraint failed" error from this code: > > "CREATE TABLE functions (" > "function_id integer PRIMARY KEY," > "function_name integer not null" > ");\n" > > > sqlite3_bind_int(statement,0,i); >

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
> Incorrect. You can bind_int or bind_int64 on an integer primary key column > just like any other column. > What does sqlite3_errcode(db) and sqlite3_errmsg(db) say after you run > sqlite3_step(pStmt) on the above? I got "19 constraint failed" error from this code: "CREATE TABLE functions (" "

[sqlite] Tcl API doc bug (was Re: [3.7.4] [BUG] [TCL] busy handler not called on lock escalation)

2011-01-26 Thread Eric Smith
Igor Tandetnik wrote: > On 1/26/2011 6:39 PM, Eric Smith wrote: > > busy handler not called on lock escalation > > This behavior is by design. See > > http://sqlite.org/c3ref/busy_handler.html > > the part that talks about a deadlock. Understood & agreed. This is a bug in the Tcl API

Re: [sqlite] [3.7.4] [BUG] [TCL] busy handler not called on lock escalation

2011-01-26 Thread Igor Tandetnik
On 1/26/2011 6:39 PM, Eric Smith wrote: > busy handler not called on lock escalation This behavior is by design. See http://sqlite.org/c3ref/busy_handler.html the part that talks about a deadlock. -- Igor Tandetnik ___ sqlite-users mailing list

Re: [sqlite] how to turn off autocommit in C interface?

2011-01-26 Thread Igor Tandetnik
On 1/26/2011 6:53 PM, Bella Chan wrote: >how to turn off autocommit in C interface? Execute a "BEGIN" or "BEGIN TRANSACTION" statement. -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] how to turn off autocommit in C interface?

2011-01-26 Thread Bella Chan
Please don't worry about this one. I figured there is no C function to turn it off by just execute a "BEGIN" sql command before other commands and a "COMMIT" at the end to achieve this. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org]

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Richard Hipp
On Wed, Jan 26, 2011 at 6:53 PM, Bella Chan wrote: > I want to confirm that it is true that I can't do bind_int on integer > primary key. > Incorrect. You can bind_int or bind_int64 on an integer primary key column just like any other column. > > If I do "insert into

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
I am already doing the prepare_v2/reset/bind_int/step/finalize set. Before I do more intensive testing to confirm my earlier findings about not much time difference between using the separate statement compared with using exec, I want to confirm that it is true that I can't do bind_int on

[sqlite] how to turn off autocommit in C interface?

2011-01-26 Thread Bella Chan
___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] [3.7.4] [BUG] [TCL] busy handler not called on lock escalation

2011-01-26 Thread Eric Smith
SQLite version 3.7.4 with TEA. gcc was run like this: gcc -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\" -DPACKAGE_VERSION=\"3.7.4\" -DPACKAGE_STRING=\"sqlite\ 3.7.4\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1

Re: [sqlite] Getting a table's field labels with Perl, DBI

2011-01-26 Thread Petite Abeille
On Jan 26, 2011, at 11:04 AM, BareFeetWare wrote: > Yes, it is very unfortunate that INFORMATION_SCHEMA or similar is not > provided by SQLite, Agree, SQLite is seriously lacking in that domain :/ > a topic that keeps recurring here in one form or another. Eh! > Yu currently have to do your

Re: [sqlite] EXTERNAL: Bus error on sqlite3_close on Sun Sparc w/SQLite 3.7.4

2011-01-26 Thread Black, Michael (IS)
My suspicion would be that you have a bug in your code which only shows up on Solaris. Something is getting corrupted on the stack. Do your compilet support stack checking? I think you can use efence on Solaris http://perens.com/FreeSoftware/ElectricFence/ Michael D. Black Senior Scientist

Re: [sqlite] SQLite version 3.7.5 - code freeze

2011-01-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > A far better solution ... would be to bump > the VFS version number to 3 That is the only solution that will not break any existing code from anyone. ie you have to use VFS 3 to opt in to getting SYNC_OMITTED (probably best delivered to

Re: [sqlite] Insert while select

2011-01-26 Thread Rich Rattanni
I was way off on the version. We are using 3.3.17. Sorry to bother you about behavior from Apr 25, 2007. I am simply curious to understand this behavior. On Wed, Jan 26, 2011 at 1:33 PM, Richard Hipp wrote: > On Wed, Jan 26, 2011 at 1:30 PM, Igor Tandetnik

[sqlite] Bus error on sqlite3_close on Sun Sparc w/SQLite 3.7.4

2011-01-26 Thread Joe Mokos
I've written an application that uses SQLite 3.7.4. The application runs fine on WinXP, AIX, HPUX and Linux. When I try to run on Solaris 5.8 SPARC I get a bus error when I call sqlite3_close. I get the following stack trace: (/opt/SUNWspro/bin/../WS6U2/bin/sparcv9/dbx) where current

Re: [sqlite] Insert while select

2011-01-26 Thread Richard Hipp
On Wed, Jan 26, 2011 at 1:30 PM, Igor Tandetnik wrote: > On 1/26/2011 11:09 AM, Rich Rattanni wrote: > > I am helping someone write an application that utilizes SQLite. The > > following code is giving us grief (sqlite lib version 3.5.ish - > > Windows XP): > > > >

Re: [sqlite] Insert while select

2011-01-26 Thread Igor Tandetnik
On 1/26/2011 11:09 AM, Rich Rattanni wrote: > I am helping someone write an application that utilizes SQLite. The > following code is giving us grief (sqlite lib version 3.5.ish - > Windows XP): > > sqlite3_prepare("select some rows") > while (sqlite3_step() == SQLITE_ROW) > { > // Do some

Re: [sqlite] stored procedures implementation for SQLite

2011-01-26 Thread Chris Wolf
Thanks for bringing that to my attention - that sample was left over from when I was trying to use APSW rather then sqlite2. The actual test program, sqlite-3.7.3/src/createproc_test.c, is correct. I updated the blog page to reflect the proper code. -Chris On Jan 26, 2011, at 12:55 PM, Jim

Re: [sqlite] SQLite version 3.7.5 - code freeze

2011-01-26 Thread Richard Hipp
On Wed, Jan 26, 2011 at 12:20 AM, Roger Binns wrote: > - > A far better solution ... would be to bump > the VFS version number to 3 Suppose we rig the default VFSes so that they return SQLITE_OK for SQLITE_FCNTL_SYNC_OMITTED, instead of SQLITE_ERROR, so that your

Re: [sqlite] TEMP TRIGGER and SQLITE_OMIT_TEMPDB

2011-01-26 Thread Richard Hipp
On Wed, Jan 26, 2011 at 1:02 PM, Marco Bambini wrote: > I am trying to use TEMP TRIGGER inside my code but every time I use it I > receive a "SQL logic error or missing database" error. > I compiled sqlite with the option SQLITE_OMIT_TEMPDB. > > [...] > so sqlite_temp_master

[sqlite] TEMP TRIGGER and SQLITE_OMIT_TEMPDB

2011-01-26 Thread Marco Bambini
I am trying to use TEMP TRIGGER inside my code but every time I use it I receive a "SQL logic error or missing database" error. I compiled sqlite with the option SQLITE_OMIT_TEMPDB. but analyzing the source code I can see for example: #ifndef SQLITE_OMIT_TRIGGER /* If there are TEMP triggers

Re: [sqlite] Multiple threads sharing one DB

2011-01-26 Thread Navaneeth.K.N
On Wed, Jan 26, 2011 at 10:24 PM, Ian Hardingham wrote: > Many thanks Eric. > > Does a write on Table A block a read/write on Table B? AFAIK, it does. The lock is acquired on the whole file and not on tables. -- -n ___ sqlite-users

Re: [sqlite] stored procedures implementation for SQLite

2011-01-26 Thread Jim Wilcoxson
It looks interesting. Should your except stmt reference apsw? -Jim -- HashBackup: easy onsite and offsite Unix backup http://www.hashbackup.com On Wed, Jan 26, 2011 at 11:38 AM, Chris Wolf wrote: > > > I know this is an old thread, but shortly after I read it, I attempted

Re: [sqlite] Multiple threads sharing one DB

2011-01-26 Thread Simon Slavin
On 26 Jan 2011, at 4:54pm, Ian Hardingham wrote: > Does a write on Table A block a read/write on Table B? SQLite only has one locking thing: it locks the entire database. So under conditions where table A would be locked, all tables would be locked in the same way. Simon.

Re: [sqlite] Insert while select

2011-01-26 Thread Simon Slavin
On 26 Jan 2011, at 4:09pm, Rich Rattanni wrote: > sqlite3_prepare("select some rows") > while (sqlite3_step() == SQLITE_ROW) > { >// Do some calc on multiple rows, and occasinally >sqlite3_exec("Insert calculated data into the same table from > which we are reading") > } >

Re: [sqlite] Multiple threads sharing one DB

2011-01-26 Thread Ian Hardingham
Many thanks Eric. Does a write on Table A block a read/write on Table B? On 26/01/2011 16:18, Eric Smith wrote: > > > On Wed, Jan 26, 2011 at 11:02 AM, Ian Hardingham > wrote: > > Hey guys. > > I am under the impression that there is no

Re: [sqlite] stored procedures implementation for SQLite

2011-01-26 Thread Chris Wolf
I know this is an old thread, but shortly after I read it, I attempted to implement stored procedures in SQLite! I only did it to see if I could, not because I necessarily think it's a good idea... It's very experimental and not fully implemented, but if anyone is interested, I checked in

Re: [sqlite] Multiple threads sharing one DB

2011-01-26 Thread Eric Smith
On Wed, Jan 26, 2011 at 11:02 AM, Ian Hardingham wrote: > Hey guys. > > I am under the impression that there is no concurrent access to a single > SQLite DB. Ie if thread A is performing a query, and thread B trys to > query, it will block until thread A is finished, no matter

[sqlite] Insert while select

2011-01-26 Thread Rich Rattanni
I am helping someone write an application that utilizes SQLite. The following code is giving us grief (sqlite lib version 3.5.ish - Windows XP): sqlite3_prepare("select some rows") while (sqlite3_step() == SQLITE_ROW) { // Do some calc on multiple rows, and occasinally

[sqlite] Multiple threads sharing one DB

2011-01-26 Thread Ian Hardingham
Hey guys. I am under the impression that there is no concurrent access to a single SQLite DB. Ie if thread A is performing a query, and thread B trys to query, it will block until thread A is finished, no matter the query. 1. Is this correct? 2. Are there any fairly general workarounds of

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Marian Cascaval
I'm no expert either in C or in SQLite but what Igor is pointing out is extremely important, because I have noticed myself the benefit of using sqlite3_prepare_v2() and sqlite3_reset() instead of just using sqlite3_exec() within iterations. And this is what SQLite documentation is talking

Re: [sqlite] forcing flush of journal

2011-01-26 Thread Simon Slavin
On 26 Jan 2011, at 2:08pm, Paul Sanderson wrote: > I have an sqlite database and an assocaiated .journal file that I need > tolook at. I have estalished that there is data in the journal that > seems relevant and want flush the journal (if that is the correct > term) and to then view the tables

[sqlite] forcing flush of journal

2011-01-26 Thread Paul Sanderson
I have an sqlite database and an assocaiated .journal file that I need tolook at. I have estalished that there is data in the journal that seems relevant and want flush the journal (if that is the correct term) and to then view the tables with the updated data. Is there a way to do this? Thanks

[sqlite] ANN: SQLite Data Wizard 11.1 released

2011-01-26 Thread SQL Maestro Group
Hi! SQL Maestro Group announces the release of SQLite Data Wizard 11.1, a powerful Windows GUI solution for SQLite data management. The new version is immediately available at http://www.sqlmaestro.com/products/sqlite/datawizard/ SQLite Data Wizard provides you with a number of easy-to-use

Re: [sqlite] Memory bloats when attaching database with WAL enabled

2011-01-26 Thread Simon Slavin
On 25 Jan 2011, at 5:08pm, Akbar Syed wrote: > I stop my application and restart it again. During restart, since the > databases are already existing, I do open all the databases (DB1, DB2 and > DB3). And Attach DB2 and DB3. Hold on. If you're doing the attaching with an 'ATTACH' command

Re: [sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Igor Tandetnik
Bella Chan wrote: > I am surprised to see that C is slower than Perl when inserting lots of data > into DB sequentially as I have 100 columns in a row > so I have been making 100 bind_int calls while Perl I only need to do execute > once. You are doing something wrong.

[sqlite] how to create sqlite3_value structure to be used with sqlite3_bind_value()?

2011-01-26 Thread Bella Chan
I am surprised to see that C is slower than Perl when inserting lots of data into DB sequentially as I have 100 columns in a row so I have been making 100 bind_int calls while Perl I only need to do execute once. Trying to see if I can use bind_value() instead but no clue ho to create the

[sqlite] Memory bloats when attaching database with WAL enabled

2011-01-26 Thread Akbar Syed
I have switched to WAL in my application for I am quite impressed with its write performances when compared to JOURNALING. After a bit struggle with checkpointing, I could successfully adopt it, yet I encountered a strange problem. Here is the scenario of my application I have more than one

[sqlite] Auto Reply: sqlite-users Digest, Vol 37, Issue 26

2011-01-26 Thread alexander . gorrod
This is an auto-replied message. I am currently unavailable. I will be back at work on Monday 31st January. For urgent questions please contact Michael Brey (michael.b...@oracle.com) ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Getting a table's field labels with Perl, DBI

2011-01-26 Thread BareFeetWare
On 26/01/2011, at 8:43 PM, John Delacour wrote: > I did try a few things along those lines and seemed to come across > the problem mentioned on that page : "...Unfortunately, > INFORMATION_SCHEMA views are seldom supported by the DBMS..." Yes, it is very unfortunate that INFORMATION_SCHEMA or

Re: [sqlite] Getting a table's field labels with Perl, DBI

2011-01-26 Thread John Delacour
At 22:41 -0800 25/01/2011, Darren Duncan wrote: >How long have you been using Perl? > >Anyway, to start with I would replace the last couple lines with: > >my $catalog_rowset = $dbh->selectall_arrayref("PRAGMA >table_info(contacts)") ; >my @col_names = map { $_->[1] } @{$catalog_rowset};