Re: [sqlite] UNION with results distinct on a particular column?

2009-03-24 Thread David Westbrook
Two possible solutions: A) pure sql ... (warning: untested) Start with all the possible col1 values, and then left join to the other tables, and pick the first col2 found. select col1, coalesce( A.col2, B.col2, C.col2 ) as col2 from ( select distinct col1 from ( select col1 from A

Re: [sqlite] starting INTEGER PRIMARY KEY at 0

2009-03-18 Thread David Westbrook
On Mon, Mar 16, 2009 at 10:08 AM, P Kishor wrote: > On Mon, Mar 16, 2009 at 8:59 AM, John Machin wrote: >> On 17/03/2009 12:33 AM, P Kishor wrote: >>> On Mon, Mar 16, 2009 at 8:31 AM, P Kishor wrote: is there a way to have a

Re: [sqlite] Perl DBD Question

2009-03-16 Thread David Westbrook
At the app level you can do something like this to check for the "database is locked(5)" error. Note the sleep and max ~1000 attempts functionality as well. my $ct = 0; while( $ct++ < 1000 ){ $dbh->do($sql, {}, @bind); if( $dbh->err == 5 ){ # If got a locked code, try again sleep 1;