[sqlite] A Bug? HAVE_LOCALTIME_S=0 under WinCE causes compile error

2010-11-17 Thread Afriza N. Arief
In my WinCE SDK, HAVE_LOCALTIME_S is defined to 1 This causes a compile error since the headers and libraries don't seem to have localtime_s() I then #define HAVE_LOCALTIME_S 0 but another compile error pops up. This time the error is because localtime() is used at line 12970 before it is

Re: [sqlite] Cannot get bind to work

2010-11-17 Thread Chris Wolf
Simon Davies wrote: > On 17 November 2010 15:27, Jay A. Kreibich wrote: > >> On Wed, Nov 17, 2010 at 10:20:22AM -0500, Chris Wolf scratched on the wall: >> >>> I am trying to familiarize myself with the lower-level routines for >>> queries, so started with the >>>

Re: [sqlite] Cannot get bind to work

2010-11-17 Thread Chris Wolf
Jay A. Kreibich wrote: > On Wed, Nov 17, 2010 at 10:20:22AM -0500, Chris Wolf scratched on the wall: > >> I am trying to familiarize myself with the lower-level routines for >> queries, so started with the >> example here: >> > > > >> not working - error 25, range erorr: >> >>

Re: [sqlite] Cannot get bind to work

2010-11-17 Thread Simon Davies
On 17 November 2010 15:27, Jay A. Kreibich wrote: > On Wed, Nov 17, 2010 at 10:20:22AM -0500, Chris Wolf scratched on the wall: >> I am trying to familiarize myself with the lower-level routines for >> queries, so started with the >> example here: > > >> not working - error 25,

Re: [sqlite] Cannot get bind to work

2010-11-17 Thread Jay A. Kreibich
On Wed, Nov 17, 2010 at 10:20:22AM -0500, Chris Wolf scratched on the wall: > I am trying to familiarize myself with the lower-level routines for > queries, so started with the > example here: > not working - error 25, range erorr: > > ./client test.sqlite "select * from emp where ename = '?'"

[sqlite] Cannot get bind to work

2010-11-17 Thread Chris Wolf
I am trying to familiarize myself with the lower-level routines for queries, so started with the example here: http://www.sqlite.org/quickstart.html ...which uses sqlite3_exec() and I replaced that with prepare/bind/step. When there are no bind parameters in the sql statement, the revised

Re: [sqlite] Selective update of a column

2010-11-17 Thread Simon Slavin
On 16 Nov 2010, at 3:29pm, Amit Chaudhuri wrote: > The approach I tried was to perform 2 sequential updates using first the > fixed call source table then the mobile. I tried to restrict the update to > rows in target where the class of call (fixed or mobile) corresponded to the > content of the

[sqlite] Selective update of a column

2010-11-17 Thread Amit Chaudhuri
Hi all, I can't work out how to do something I feel ought to be easy. Attached small file is designed to be .read to provide a test case. Explanation of what I'm trying to follows below. I have two separate but very similar source data sets, one for mobile one for fixed calls of various

Re: [sqlite] Strange Corruption

2010-11-17 Thread Pirmin Walthert
.dump (3.6.23.1) and afterwards "sqlite3 /tmp/new.db < /tmp/dump.sql" with 3.7.2 worked and fixed the .backup problem (as expected). As I've already downgraded sqlite3 in our new firmware and patched the live-systems that were running with the new firmware I'll only have one machine to check

Re: [sqlite] Key Value pairs in a table

2010-11-17 Thread luuk34
On 17-11-10 10:32, Arigead wrote: > Hi all, > I've started to use an existing Database with C source code. As I'm new > to > all this I can't moan about database design but I'm sure that Key Value pairs > in a Database table suits modern languages like Python down to the ground. It > ain't

Re: [sqlite] Simple SQL question?

2010-11-17 Thread Bart Smissaert
Tried your SQL, but it doesn't run. Will fiddle it and see if I can make it work. RBS On Wed, Nov 17, 2010 at 9:00 AM, luuk34 wrote: > On 17-11-10 09:58, Bart Smissaert wrote: >> What do you suggest should be the full SQL then? >> > select  t1.patient_id > from    table1 t1 >

Re: [sqlite] Simple SQL question?

2010-11-17 Thread luuk34
On 17-11-10 10:00, luuk34 wrote: > On 17-11-10 09:58, Bart Smissaert wrote: >> What do you suggest should be the full SQL then? >> > select t1.patient_id > fromtable1 t1 > join( > select table1.address, > min( table1.date_of_birth ) as

Re: [sqlite] Simple SQL question?

2010-11-17 Thread luuk34
On 17-11-10 09:58, Bart Smissaert wrote: > What do you suggest should be the full SQL then? > select t1.patient_id fromtable1 t1 join( select table1.address, min( table1.date_of_birth ) as date_of_birth fromtable1

Re: [sqlite] Simple SQL question?

2010-11-17 Thread Bart Smissaert
What do you suggest should be the full SQL then? RBS On Wed, Nov 17, 2010 at 8:16 AM, luuk34 wrote: > On 17-11-10 00:17, Petite Abeille wrote: >> select  t1.patient_id >> from    table1 t1 >> join    ( >>              select      table1.address, >>                          

Re: [sqlite] Simple SQL question?

2010-11-17 Thread Bart Smissaert
Tried your SQL, but it doesn't look right and didn't run. Will see if I can alter it. RBS On Tue, Nov 16, 2010 at 11:17 PM, Petite Abeille wrote: > > On Nov 16, 2010, at 11:55 PM, Bart Smissaert wrote: > >> This seems to work fine, > > Then you are golden :) > >> but

Re: [sqlite] Simple SQL question?

2010-11-17 Thread Bart Smissaert
That is a strange construction and for now I haven't got it to work yet in my VB application. It does run though in Firefox SQLite manager. Maybe after all the SQL I came up with in the end wasn't that bad. RBS On Wed, Nov 17, 2010 at 12:09 AM, Igor Tandetnik wrote: > Bart

Re: [sqlite] Simple SQL question?

2010-11-17 Thread luuk34
On 17-11-10 00:17, Petite Abeille wrote: > select t1.patient_id > fromtable1 t1 > join( > select table1.address, > min( table1.date_of_birth ) as date_of_birth > fromtable1 > group bytable1.address >