Re: [sqlite] Select with dates

2013-09-13 Thread Keith Medcalf
> On Thu, 12 Sep 2013 14:01:04 +0100 > Simon Davies wrote: > > > Why not > > SELECT * FROM "entry" WHERE > >bankdate >= date('now','start of month') > > AND bankdate < date('now','start of month','+1 month') > > The half-open interval strikes again! :-) And you are us

Re: [sqlite] Insert statement

2013-09-13 Thread Keith Medcalf
Or, if you are binding the values you can always do something like (a single statement): insert or ignore into table (val) values (:val); select id from table where val = :val; Where you bind you long val string value to the parameter named "val". This has the advantage that you only bind (p

Re: [sqlite] Select with dates

2013-09-13 Thread James K. Lowden
On Thu, 12 Sep 2013 14:01:04 +0100 Simon Davies wrote: > Why not > SELECT * FROM "entry" WHERE >bankdate >= date('now','start of month') > AND bankdate < date('now','start of month','+1 month') The half-open interval strikes again! :-) --jkl __

Re: [sqlite] Insert statement

2013-09-13 Thread James K. Lowden
On Thu, 12 Sep 2013 18:15:29 + "Joseph L. Casale" wrote: > > If you make val unique -- and I see no reason not to -- then you > > can select the id for every val you insert with "where val = > > I omitted the fact that val in table_a is unique. Ah, that will be very helpful. > Sending on

Re: [sqlite] logical to use sqlite to replace Berkeley DB ?

2013-09-13 Thread Howard Chu
Patrick wrote: Hi Everyone After Oracle acquired Berkeley DB they changed the license. If people don't pay a significant licensing fee, it can now only be used for GPL code. I don't know Berkeley DB very well but I do know a moderate amount of Sqlite. I want to tinker with a compiler that uses

[sqlite] logical to use sqlite to replace Berkeley DB ?

2013-09-13 Thread Patrick
Hi Everyone After Oracle acquired Berkeley DB they changed the license. If people don't pay a significant licensing fee, it can now only be used for GPL code. I don't know Berkeley DB very well but I do know a moderate amount of Sqlite. I want to tinker with a compiler that uses DB, I was t

Re: [sqlite] WAL Checkpointing question

2013-09-13 Thread Simon Slavin
On 13 Sep 2013, at 6:00pm, Andrew Beal wrote: > When you issue a checkpoint command to the SQLite system and it fails on a > hardware I/O error when interacting with the database, is there a way to use > the WAL to rebuild the database or is the database corrupt beyond repair at > that point?

Re: [sqlite] WAL Checkpointing question

2013-09-13 Thread Richard Hipp
On Fri, Sep 13, 2013 at 1:00 PM, Andrew Beal wrote: > All, > > When you issue a checkpoint command to the SQLite system and it fails on a > hardware I/O error when interacting with the database, is there a way to > use the WAL to rebuild the database or is the database corrupt beyond > repair at

[sqlite] WAL Checkpointing question

2013-09-13 Thread Andrew Beal
All, When you issue a checkpoint command to the SQLite system and it fails on a hardware I/O error when interacting with the database, is there a way to use the WAL to rebuild the database or is the database corrupt beyond repair at that point? F. Andrew Beal Woods Hole Oceanographic Institut

Re: [sqlite] Dynamically generate SQL statements for SQLite

2013-09-13 Thread Simon Slavin
On 13 Sep 2013, at 3:26am, Mun Wai Chan wrote: > I was wondering if there are any software that would dynamically generate SQL > statements for SQLite using C#. For example, I would like to be able to do > this: > > var sqlStatement = sqlGenerator.Select("Name").From("Customers").ToSQL(); >

[sqlite] Dynamically generate SQL statements for SQLite

2013-09-13 Thread Mun Wai Chan
Hi all, I was wondering if there are any software that would dynamically generate SQL statements for SQLite using C#. For example, I would like to be able to do this: var sqlStatement = sqlGenerator.Select("Name").From("Customers").ToSQL(); I only know the names of tables and fields at runtime