Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-05 Thread Bob Moran
Thank you guys for the responses. Great info to consider. I was quite confused but the fact that by waiting some length of time after startup of the app, that everything appeared to work. I repeated ran the troublesome call (without stopping the app), and it would work the 6-7 times of making the c

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-05 Thread Nelson, Erik - 2
Bob Moran wrote on: Friday, September 05, 2014 12:07 AM > On Wed, Sep 3, 2014 at 1:29 PM, Nelson, Erik - 2 < > erik.l.nel...@bankofamerica.com> wrote: > > > Bob Moran wrote on Wednesday, September 03, 2014 12:45 PM > > > > > > One added note: My GUI is using QT4, where in this case the SQL > text

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-04 Thread Alessandro Marzocchi
Another solution would be moving the call to qprintable inside the prepare_v2 call: sqlite3_prepare_v2( db, qPrintable(qstr) , qstr.length()+1, &stmt, NULL) I don't know if this is your case but please note that I think this way would not handle well some Unicode strings (the ones for which utf8 a

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-04 Thread Alessandro Marzocchi
You could use QString::constData which returns a pointer to internal data to the string encoded in utf16 and then change the call to sqlite3_prepare16_v2... Il 05/set/2014 06:08 "Bob Moran" ha scritto: > Erik, > Are you implying that I must copy the text returned by qPrintable(sql) to a > safe lo

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-04 Thread Bob Moran
Erik, Are you implying that I must copy the text returned by qPrintable(sql) to a safe location before calling a method that uses it? I thought that the string would be valid until I return from the routine. Bob Moran On Wed, Sep 3, 2014 at 1:29 PM, Nelson, Erik - 2 < erik.l.nel...@bankofamerica

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-03 Thread Nelson, Erik - 2
Bob Moran wrote on Wednesday, September 03, 2014 12:45 PM > > One added note: My GUI is using QT4, where in this case the SQL text > goes something like: > > QString qstr = "select id, step, temp from protocols where id > = %1"; > qstr = qstr.arg(id); > char * str = (char*)qPrin

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-03 Thread Bob Moran
retrieve SQLite Db Data Immediately After Application Startup On 3 Sep 2014, at 5:18pm, Bob Moran wrote: > I am using the amalgamation. Simply added the SQLITE3.c and .H files to my > project. I am developing with VisualGDB (VS 2010) cross compiling (building > on Windows 7, runni

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-03 Thread Bob Moran
r.Length+1, &stmt, NULL) -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Wednesday, September 03, 2014 12:51 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Cannot retrieve SQLite Db Da

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-03 Thread Simon Slavin
On 3 Sep 2014, at 5:18pm, Bob Moran wrote: > I am using the amalgamation. Simply added the SQLITE3.c and .H files to my > project. I am developing with VisualGDB (VS 2010) cross compiling (building > on Windows 7, running on RPI). No added compiler directives (hopefully, that > is the problem

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-03 Thread Bob Moran
-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Wednesday, September 03, 2014 12:51 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup > On 3 Sep 2014, a

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-03 Thread Hick Gunter
SQLite Database Betreff: Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup Found more of what the issue is. I noticed that my SQL text was being overwritten on the return from the call to prepare_v2. Stepping through the SQlite3 code I discovered that a malloc call for

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-02 Thread Simon Slavin
> On 3 Sep 2014, at 5:24am, Bob Moran wrote: > > Found more of what the issue is. I noticed that my SQL text was being > overwritten on the return from the call to prepare_v2. > Stepping through the SQlite3 code I discovered that a malloc call for 500+ > bytes was returning a pointer 8 bytes b

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-02 Thread Bob Moran
t: Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup On 29/08/14 12:55, Bob Moran wrote: > The return code (rc) is SQLITE_OK, but "stmnt" is NULL (0) > > if I start the application and wait for at least 1 minute, everything works. You get NUL

Re: [sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-09-02 Thread Roger Binns
On 29/08/14 12:55, Bob Moran wrote: > The return code (rc) is SQLITE_OK, but "stmnt" is NULL (0) > > if I start the application and wait for at least 1 minute, everything works. You get NULL back from prepare with SQLITE_OK if the statement doesn't do anything. Examples are empty strings or comm

[sqlite] Cannot retrieve SQLite Db Data Immediately After Application Startup

2014-08-30 Thread Bob Moran
Application running on Linux Debian (Raspberry Pi. I am using QT4 and SQLite3.c V3.8.6 embedded in the application).using VisualGDB cross compiler running in RPI. The problem occurs on first startup. With the database open via: sqlite3_open_v2("/home/pi/mydatabase.db", &db, SQLITE_OPEN_READWRITE,