Re: [sqlite] SQL logic error or missing database no such table

2016-05-24 Thread R.A. Nagy
We only use .commit when we are using transactions: If any type of "BEGIN TRANSACTION;" is underway, a failure to "COMMIT;" data will guarantee that data will not be in a database. Interestingly however, even when not committed our queries will still work - our data will simply not be available in

Re: [sqlite] SQL logic error or missing database no such table

2016-05-24 Thread Rajendra Shirhatti
Hi Randall, I was googling around and it seems like some people had the same issue where the data was lost after the connection was closed. In my case, the connection is a singleton which is used by multiple threads. I do not close the connection explicitly, let it close automatically when the

[sqlite] SQL logic error or missing database no such table

2016-05-23 Thread R.A. Nagy
Are we sure that data are being stored at-all? Also, how is the database being encrypted? On Sun, May 22, 2016 at 3:02 PM, Rajendra Shirhatti wrote: > Hi Randall, > Thank you so much for your reply. > I don't have enough data to confirm whether database file is missing or > it's due to some

[sqlite] SQL logic error or missing database no such table

2016-05-23 Thread Rajendra Shirhatti
Yes, I'm very positive the data is stored otherwise the application would throw some exception. The database is encrypted by calling passing a private key to the connection using ChangePassword(). Thank you, Raj On Mon, May 23, 2016 at 9:16 AM, R.A. Nagy wrote: > Are we sure that data are

[sqlite] SQL logic error or missing database no such table

2016-05-22 Thread Rajendra Shirhatti
Hi Randall, Thank you so much for your reply. I don't have enough data to confirm whether database file is missing or it's due to some other reason. According to my initial investigation, it looks like the application is able to create database and perform all the operations successfully upon

[sqlite] SQL logic error or missing database no such table

2016-05-22 Thread R.A. Nagy
Try: .schema [tablename] Since there is probably nothing there, you probably need to create a table. If you are new to SQL / SQLite, then here are some helpful videos: https://www.youtube.com/playlist?list=PLItP5KoawLqkPV2jqAVCH79fZGO5k0Uzy Cheers, -Randall Nagy President, Soft9000.com

[sqlite] SQL logic error or missing database no such table

2016-05-21 Thread Rajendra Shirhatti
Hi, We've a .Net Windows Service that uses SQLite 1.0.93.0 for database operations. The SQLite package contains two binaries, system.data.sqlite.dll and sqlite.interop.dll. The database is encrypted and the blob it contains is encrypted as well. SQLite is intermittently throwing following

[sqlite] SQL logic error or missing database no such table: config

2014-10-06 Thread Alessio Fabriziani
Hello, Using SQLite for C# (package from NuGet). In some cases...I get this exception but database and table are present. Why I get this exception? Corruption? What? Thanks Best Regards ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] SQL logic error or missing database with Python sqlite

2013-07-26 Thread C M
This appears to have been asked many times online, but none of the threads I've seen help me fix my issue. I am using SQLite through Python 2.5 or 2.7, which is the sqlite3 module. In a desktop application, every now and then, and in a fairly irreproducible way, when committing to the database I

Re: [sqlite] SQL Logic error or missing database

2013-04-07 Thread Pavel Ivanov
Do you know that VS2012 has known optimizer bugs? Pavel On Apr 6, 2013 5:01 AM, "ibrahim" wrote: > On 05.04.2013 17:01, Dan Kennedy wrote: > >> On 04/05/2013 09:08 PM, Rob Collie wrote: >> >>> Yeap, I'm on Visual Studio 2012. I've created a console app: >>> >>> >>>

Re: [sqlite] SQL Logic error or missing database

2013-04-06 Thread ibrahim
On 05.04.2013 17:01, Dan Kennedy wrote: On 04/05/2013 09:08 PM, Rob Collie wrote: Yeap, I'm on Visual Studio 2012. I've created a console app: sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2("file://C:/Newfolder/testing.db", , SQLITE_OPEN_CREATE, NULL); if

Re: [sqlite] SQL Logic error or missing database

2013-04-06 Thread ibrahim
On 05.04.2013 16:47, Rob Collie wrote: sqlite3_open_v2("file://C:/Newfolder/testing.db", > > > >& oDatabase, SQLITE_OPEN_CREATE, NULL); Can you try : returnValue = sqlite3_open_v2 ("C:\\Newfolder\\testing.db", , SQLITE_OPEN_CREATE, NULL) ; Use double backslash also after "file://"

Re: [sqlite] SQL Logic error or missing database

2013-04-06 Thread ibrahim
On 05.04.2013 14:54, Rob Collie wrote: Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from fortran... CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) ...runs the following code, and yet the error returned is

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
atabase)); > } > else { > printf("Got it\n"); > } > } > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie > Sent: Friday, April 05, 2013 9:47 AM > To: General Dis

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Stephenson
As Dan said, the console app needs the read/write flag. The other app appears to be using CStringW, but the api takes a const char *, not a wide char pointer. I'd try CStringA and explicitly cast to LPCSTR. Michael Stephenson On Apr 5, 2013, at 11:01 AM, Dan Kennedy

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
nal Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie Sent: Friday, April 05, 2013 9:47 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL Logic error or missing database Nothing seems to be overly weird, and the console

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Dan Kennedy
On 04/05/2013 09:08 PM, Rob Collie wrote: Yeap, I'm on Visual Studio 2012. I've created a console app: sqlite3 *oDatabase; int returnValue; returnValue = sqlite3_open_v2("file://C:/Newfolder/testing.db", , SQLITE_OPEN_CREATE, NULL); if (returnValue != SQLITE_OK ) {

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
I've tried with just the one .h, it's the same result for both. On Fri, Apr 5, 2013 at 4:52 PM, Kevin Martin wrote: > > On 5 Apr 2013, at 14:12, Rob Collie wrote: > > > I'm pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a > C++ > > project and compiling it

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Kevin Martin
On 5 Apr 2013, at 14:12, Rob Collie wrote: > I'm pretty much just including sqlite3.h, sqlite3ext.h, sqlite3.c in a C++ > project and compiling it as a static lib. I don't really know anything about Windows, but this looks a bit different to how I do it on Linux. I think you should only

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Nothing seems to be overly weird, and the console app is a fresh project, with very little changed. I'm compiling under 32-bit in VS2012 using the amalgamation files. I can attach my test project if needed. I'm really rather curious to know what I broke. On Fri, Apr 5, 2013 at 4:28 PM, Noel

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
-boun...@sqlite.org] On Behalf Of Rob Collie > Sent: Friday, April 05, 2013 9:25 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] SQL Logic error or missing database > > Same problem, I'm afraid. I've tried just about every combination suggested > in http://www.

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
Collie Sent: Friday, April 05, 2013 9:25 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL Logic error or missing database Same problem, I'm afraid. I've tried just about every combination suggested in http://www.sqlite.org/c3ref/open.html _

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
it's time to check your compiler setting, anything weird ? Are you sure you have the source code of sqlite for windows ? 32 or 64 bits settings ?? On 5 April 2013 16:24, Rob Collie wrote: > Same problem, I'm afraid. I've tried just about every combination suggested > in

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Same problem, I'm afraid. I've tried just about every combination suggested in http://www.sqlite.org/c3ref/open.html On Fri, Apr 5, 2013 at 4:18 PM, Kevin Benson wrote: > On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie wrote: > > > Yeap, I'm on

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Kevin Benson
On Fri, Apr 5, 2013 at 10:08 AM, Rob Collie wrote: > Yeap, I'm on Visual Studio 2012. I've created a console app: > > > sqlite3 *oDatabase; > int returnValue; > returnValue = sqlite3_open_v2("file://C:/Newfolder/testing.db", > & oDatabase, SQLITE_OPEN_CREATE, NULL); >

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie > > Sent: Friday, April 05, 2013 7:54 AM > > To: sqlite-users@sqlite.org > > Subject: [sqlite] SQL Logic error or missing database > > > > Hello there, > > > > For my sins, I'm trying to cr

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie > Sent: Friday, April 05, 2013 7:54 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] SQL Logic error or missing database > > Hello there, > > For my sins,

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
Also change the last arg of open to NULL instead of "". -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Collie Sent: Friday, April 05, 2013 7:54 AM To: sqlite-users@sqlite.org Subject: [sqlite] SQL Logic error

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
something odd, check you compilation setup, are you on windows with visual studio ? create a small console sample On 5 April 2013 15:27, Rob Collie wrote: > Yeap. I've tested on the desktop, running as an admin user. I've tried the > full path, with no luck. > > Should

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
e.org] On Behalf Of Rob Collie > Sent: Friday, April 05, 2013 7:54 AM > To: sqlite-users@sqlite.org > Subject: [sqlite] SQL Logic error or missing database > > Hello there, > > For my sins, I'm trying to create a library allowing our legacy fortran > code to work with SQL

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Michael Black
@sqlite.org Subject: [sqlite] SQL Logic error or missing database Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from fortran... CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) ...runs the following code, and yet

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Yeap. I've tested on the desktop, running as an admin user. I've tried the full path, with no luck. Should SQLITE_OPEN_READWRITE not be used with SQLITE_OPEN_CREATE? If I remove the SQLITE_OPEN_READWRITE flag, I get 'library routine called out of sequence' instead. Rob. On Fri, Apr 5, 2013 at

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Simon Slavin
On 5 Apr 2013, at 1:54pm, Rob Collie wrote: > CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) > ...runs the following code, and yet the error returned is 'SQL Logic error > or missing database'. No file is ever created. Is there something dumb I'm > missing here?

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
SQLITE_OPEN_READWRITE The database is opened for reading and writing if possible, or reading only if the file is write protected by the operating system. In either case the database must already exist, otherwise an error is returned. Is it

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
no it should be ok, check the place where testing.db should be created, do you have write right ? On 5 April 2013 15:12, Rob Collie wrote: > It's a very odd problem. At first I was worried about character > translations between fortran and C, but the following also fails:

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
It's a very odd problem. At first I was worried about character translations between fortran and C, but the following also fails: returnValue = sqlite3_open_v2("testing.db", , SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE, ""); I guess this rules out encoding too? Perhaps it's something to do with

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Noel Frankinet
Is your filename UTF8 ? On 5 April 2013 15:02, Richard Hipp wrote: > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie wrote: > > > Hello there, > > > > For my sins, I'm trying to create a library allowing our legacy fortran > > code to work with SQL. > > > >

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Richard Hipp
On Fri, Apr 5, 2013 at 9:02 AM, Richard Hipp wrote: > > > On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie wrote: > >> Hello there, >> >> For my sins, I'm trying to create a library allowing our legacy fortran >> code to work with SQL. >> >> Calling this from

Re: [sqlite] SQL Logic error or missing database

2013-04-05 Thread Richard Hipp
On Fri, Apr 5, 2013 at 8:54 AM, Rob Collie wrote: > Hello there, > > For my sins, I'm trying to create a library allowing our legacy fortran > code to work with SQL. > > Calling this from fortran... > > CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) > ...runs the

[sqlite] SQL Logic error or missing database

2013-04-05 Thread Rob Collie
Hello there, For my sins, I'm trying to create a library allowing our legacy fortran code to work with SQL. Calling this from fortran... CALL EXECUTESQL('dbTest'//CHAR(0), cQuery, iReturnValue) ...runs the following code, and yet the error returned is 'SQL Logic error or missing database'. No

Re: [sqlite] SQL logic error or missing database

2012-10-24 Thread Gert Van Assche
Kees, thanks. I reopened the connection and all is OK now. thanks for your help, gert 2012/10/24 Kees Nuyt > On Wed, 24 Oct 2012 15:53:39 +0200, Gert Van Assche > wrote: > > >All, hoping you can help me. > > > >I bumped into an "SQL logic error or

Re: [sqlite] SQL logic error or missing database

2012-10-24 Thread Simon Slavin
On 24 Oct 2012, at 3:42pm, Gert Van Assche wrote: > I have permissions and I'm using the short string of the > full path. Just for testing, try specifying a full path and see what happens. Simon. ___ sqlite-users mailing list

Re: [sqlite] SQL logic error or missing database

2012-10-24 Thread Gert Van Assche
Simon, I'm using LUA. I have permissions and I'm using the short string of the full path. I'm now investigating something Kees mentioned: "Perhaps the path/filename in your _open() statement is not correct (does not point to the same file as the command line does), or the open flags/URI arguments

Re: [sqlite] SQL logic error or missing database

2012-10-24 Thread Kees Nuyt
On Wed, 24 Oct 2012 15:53:39 +0200, Gert Van Assche wrote: >All, hoping you can help me. > >I bumped into an "SQL logic error or missing database" error and I don't >have a clue why this happens. >It happens on the first action I take in a series of all the same actions

Re: [sqlite] SQL logic error or missing database error

2012-08-16 Thread Rittick Gupta
Why would it work with the subseqyent open if there was a problem with the install ? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQL logic error or missing database error

2012-08-16 Thread Brandon Pimenta
Reinstall SQLite. On Thu, Aug 16, 2012 at 5:46 PM, Rittick Gupta <ritt...@yahoo.com> wrote: > SQL logic error or missing database _______ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] SQL logic error or missing database error

2012-08-16 Thread Rittick Gupta
I get the following error while opening the database after a system reboot. SQL logic error or missing database The problem does not happen with the subsequent open with a new process. Is there any reason why we get these errors? ___ sqlite-users

Re: [sqlite] SQL logic error or missing database

2009-05-15 Thread Igor Tandetnik
Alex Ousherovitch wrote: > Is it safe to use sqlite3_errmsg() when each thread is using its own > connection handle Yes. Each connection allocates its own memory for this string. Igor Tandetnik ___ sqlite-users

Re: [sqlite] SQL logic error or missing database

2009-05-15 Thread Alex Ousherovitch
>> At the end of the loop, instead of having 4000 rows I have 3976 rows >> (it's random, sometimes I have 3972 or 3974). >> sqlite3_exec doesn't returns any error during the INSERT statement, >> but I have some errors during the BEGIN IMMEDIATE, errors are all: >> SQL logic error or missing

Re: [sqlite] SQL logic error or missing database

2009-05-14 Thread Marco Bambini
Thanks a lot for the explanation Igor. -- Marco Bambini On May 14, 2009, at 1:55 PM, Igor Tandetnik wrote: > "Marco Bambini" wrote > in message news:aa7dd05f-4679-43dd-9dd3-2ba6b98af...@sqlabs.net >> I have two threads that are writing 2000 rows each to the same >>

Re: [sqlite] SQL logic error or missing database

2009-05-14 Thread Igor Tandetnik
"Marco Bambini" wrote in message news:aa7dd05f-4679-43dd-9dd3-2ba6b98af...@sqlabs.net > I have two threads that are writing 2000 rows each to the same > database at the same time. > I am using sqlite 3.6.13 compiled with SQLITE_THREADSAFE=1. > > Each client executes this code

[sqlite] SQL logic error or missing database

2009-05-14 Thread Marco Bambini
I have two threads that are writing 2000 rows each to the same database at the same time. I am using sqlite 3.6.13 compiled with SQLITE_THREADSAFE=1. Each client executes this code (pseudo C code): void write (sqlite3 *db) { int i; for (i=1; i<=2000; i++) { if

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-11-05 Thread dbikash
I'm back again. I could not ignore such a strong suggestion of not using thread. So I am planning on a single threaded event driven model for my application. I also plan to use sqlite3_progress_handler() to handle query cancellation. I compiled SQLite with the flags SQLITE_THREADSAFE=0. Even

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-11-03 Thread D. Richard Hipp
On Nov 3, 2008, at 9:54 AM, Ken wrote: > No I would not wrap the querries in a transaction. > > I think the problem you are encountering is due to thread > interaction upon the sqlite structures. Since it was compiled with > THREADsafety disabled. > > If you have two threads that share the

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-11-03 Thread Ken
when starting transactions and the prepare and first calls to step (ie for selects). Hope that helps --- On Mon, 11/3/08, dbikash <[EMAIL PROTECTED]> wrote: > From: dbikash <[EMAIL PROTECTED]> > Subject: Re: [sqlite] "SQL logic error or missing database" w

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-11-03 Thread dbikash
ess. If you fail with sqlite busy. Simply sleep a short while > (hint usleep) loop and try again. > > HTH > Ken > > > > --- On Fri, 10/31/08, dbikash <[EMAIL PROTECTED]> wrote: > >> From: dbikash <[EMAIL PROTECTED]> >> Subject: Re: [sqlite]

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread Ken
and try again. HTH Ken --- On Fri, 10/31/08, dbikash <[EMAIL PROTECTED]> wrote: > From: dbikash <[EMAIL PROTECTED]> > Subject: Re: [sqlite] "SQL logic error or missing database" with > multithreaded program > To: sqlite-users@sqlite.org > Date: Friday, Octobe

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread dbikash
> or missing database). What could be the problem? > > Is that the error message text that SQLite returns: "SQL logic error > or missing database"? Or is that just the meaning of SQLITE_ERROR > that you looked up? What error message does sqlite3

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread D. Richard Hipp
On Oct 31, 2008, at 9:46 AM, dbikash wrote: > > I get a SQLite error 1 (SQL logic error > or missing database). What could be the problem? Is that the error message text that SQLite returns: "SQL logic error or missing database"? Or is that just the meaning of SQLITE_ERRO

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread dbikash
I prepare the statement once. But I use transaction for every bunch of 500 record inserts. mikewhit wrote: > > dbikash <[EMAIL PROTECTED]> writes: > >> >> >> Hello, >> ... >> - Thread 1 inserts 500 records to the database every 30 seconds and then >> goes to sleep. (I prepare an insert

Re: [sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread MikeW
dbikash <[EMAIL PROTECTED]> writes: > > > Hello, > ... > - Thread 1 inserts 500 records to the database every 30 seconds and then > goes to sleep. (I prepare an insert statement, BEGIN TRANSACTION, bind > values, step through the statement, reset the statement, and do END > TRANSACTION) >

[sqlite] "SQL logic error or missing database" with multithreaded program

2008-10-31 Thread dbikash
Hello, I am writing a program using SQLite that uses two threads performing the following operations in an infinite loop: - Thread 1 inserts 500 records to the database every 30 seconds and then goes to sleep. (I prepare an insert statement, BEGIN TRANSACTION, bind values, step through the

Re: [sqlite] SQL logic error or missing database in version 3.5.6(Bug???)

2008-03-19 Thread Steve Topov
: Re: [sqlite] SQL logic error or missing database in version 3.5.6(Bug???) "Steve Topov" <[EMAIL PROTECTED]> wrote: > Hello, > > Recently I upgraded SQLite to version 3.5.6 and discovered that my > program can't work anymore with some database files. Sqlite3_open > r

Re: [sqlite] SQL logic error or missing database in version 3.5.6 (Bug???)

2008-03-18 Thread drh
"Steve Topov" <[EMAIL PROTECTED]> wrote: > Hello, > > Recently I upgraded SQLite to version 3.5.6 and discovered that my > program can’t work anymore with some database files. Sqlite3_open > returns OK, but when I am trying to execute any SQL statement it returns > “SQL logic error or missing

[sqlite] SQL logic error or missing database

2007-10-14 Thread Yvon Thoraval
Hey all, i've an SQLite 3 database coming from a mobile phone (e2831) which works well on the phone itself : BEGIN TRANSACTION; CREATE TABLE devicephonebook( UID INTEGER PRIMARY KEY AUTOINCREMENT ,lastName TEXT NOT NULL DEFAULT(''),firstName TEXT NOT NULL DEFAULT(''), lastChar INTEGER

Re: [sqlite] "SQL logic error or missing database"

2006-05-24 Thread Ran
Actually, the multiple connections are created from different threads. But those threads did not access the database in the same moment when the problem occured, so I assumed (correctly) that the bug happens also when the connections are done from the same thread. And this is how I created the

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread John Stanton
Why do you connect twice to the DB? You then run into synchronization issues. JS Ran wrote: Hi all, Could someone help me with the script below? I get an "SQL logic error or missing database" and cannot find what I do wrong. I use sqlite 3.3.4 on Linux. What I do there is: 1. Open

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread drh
Ran <[EMAIL PROTECTED]> wrote: > Indeed if I reset after the first step failed, and than prepare again, the > select works. But I guess this is not the usual way to do things right? I > mean - shouldn't the first prepare be aware of the fact that the database > was changed? Or maybe CREATE TABLE

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread drh
Ran <[EMAIL PROTECTED]> wrote: > > rc = sqlite3_step(pStmt3); > if (rc != SQLITE_DONE) { // if we failed, we log it. > printf("Failed to step statement: %s\n", sqlite3_errmsg(db1)); > } The sqlite3_errmsg() API does not return the correct error message text until after you do

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Ran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 11:47 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > Indeed if I reset after the first step failed, and than &g

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Craig Morrison
Ran wrote: Indeed if I reset after the first step failed, and than prepare again, the select works. But I guess this is not the usual way to do things right? I mean - shouldn't the first prepare be aware of the fact that the database was changed? Or maybe CREATE TABLE is a special case? If I

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Jay Sprenkle [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 11:27 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > It was prepared after the schema was changed and writt

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Ran
Indeed if I reset after the first step failed, and than prepare again, the select works. But I guess this is not the usual way to do things right? I mean - shouldn't the first prepare be aware of the fact that the database was changed? Or maybe CREATE TABLE is a special case? On 5/23/06, Jay

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
On 5/23/06, Robert Simpson <[EMAIL PROTECTED]> wrote: > That doesn't seem right. > The change was made and committed then the database statement > prepared. > The change should have already been written so the prepare > should have gotten the latest stuff. Does it need to be > closed and

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Jay Sprenkle [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 10:55 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > On 5/23/06, Robert Simpson <[EMAIL PROTECTED]>

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
On 5/23/06, Robert Simpson <[EMAIL PROTECTED]> wrote: After sqlite3_step() fails, you should call sqlite3_reset() on the statement. This is what will give you the SQLITE_SCHEMA error, indicating you need to re-prepare your statement. That doesn't seem right. The change was made and committed

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Robert Simpson [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 10:30 AM > To: sqlite-users@sqlite.org > Subject: RE: [sqlite] "SQL logic error or missing database" > [snip] > rc = sqlite3_step(pStmt3); >

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Ran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 10:08 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > Oh! Did you run it with a parameter so: > > ./bug 1 &g

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Ran
3, 2006 8:37 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > On 5/23/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: > > hmmm... > > it gives a schema changed because 'delete * from x' > actually drops t

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
On 5/23/06, Robert Simpson <[EMAIL PROTECTED]> wrote: I pasted your code into my Windows environment and ran it. It completed successfully with no errors. which version of sqlite are you using?

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Jay Sprenkle [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 9:53 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > On 5/23/06, Ran <[EMAIL PROTECTED]&g

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Ran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 8:37 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > On 5/23/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: >

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
On 5/23/06, Ran <[EMAIL PROTECTED]> wrote: Thanks for your replies. Actually, in my last email (probably you got it after sending yours), there is a script which exec the create statements, and check the prepare returned value of a SELECT (and not delete). Still I get the same bug. So the

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Jay Sprenkle [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 8:13 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] "SQL logic error or missing database" > > hmmm... > it gives a schema changed because '

RE: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Robert Simpson
> -Original Message- > From: Ran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 6:38 AM > To: sqlite-users > Subject: [sqlite] "SQL logic error or missing database" > [snip] > Here is the script: [snip] > rc = sqlite3_prepare(db1,

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Ran
On 5/23/06, Jay Sprenkle <[EMAIL PROTECTED]> wrote: hmmm... it gives a schema changed because 'delete * from x' actually drops the table but I'm not sure why it gave an error since the prepare was done after the other change was committed... ... Thanks for your efforts! I am afraid that the

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
I don't see any reason why this should not work. I can reproduce it with vc6. You should ask DRH if he can explain what's up.

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
hmmm... it gives a schema changed because 'delete * from x' actually drops the table but I'm not sure why it gave an error since the prepare was done after the other change was committed... program output: Opened the database. Opened the database. Failed to step statement: database schema has

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Ran
Thanks for your answer. Actually, I tried to have resets there although I think that finalize is as good in releasing the locks on tables. It didn't help. I do it with prepare and step because this script is a demo of a bug I have in my code, where I use all over a certain function that prepare

Re: [sqlite] "SQL logic error or missing database"

2006-05-23 Thread Jay Sprenkle
On 5/23/06, Ran <[EMAIL PROTECTED]> wrote: Hi all, rc = sqlite3_prepare(db1,// Database handle "create table bla(a int,b int)", -1, // Length of the statement , // OUT: Statement handle

[sqlite] "SQL logic error or missing database"

2006-05-23 Thread Ran
Hi all, Could someone help me with the script below? I get an "SQL logic error or missing database" and cannot find what I do wrong. I use sqlite 3.3.4 on Linux. What I do there is: 1. Open connection to a new database. 2. Create table bla in a transaction. 3. Open another connection to the