Re: [sqlite] Using pragma user_version when doing updates

2013-09-17 Thread Scott Robison
Could be an interesting virtual table module... On Tue, Sep 17, 2013 at 6:24 PM, Darren Duncan wrote: > On 2013.09.17 4:28 PM, Richard Hipp wrote: > >> On Tue, Sep 17, 2013 at 7:13 PM, Amit wrote: >> >> Hello, >>> >>> I would like to run the

Re: [sqlite] Using pragma user_version when doing updates

2013-09-17 Thread Darren Duncan
On 2013.09.17 4:28 PM, Richard Hipp wrote: On Tue, Sep 17, 2013 at 7:13 PM, Amit wrote: Hello, I would like to run the following update statement if pragma user_version == 2. How can I incorporate that in this query? UPDATE pass_key SET key = (SELECT textval FROM

Re: [sqlite] Using pragma user_version when doing updates

2013-09-17 Thread Amit
Richard Hipp writes: > > You can access the user version using "PRAGMA user_version". > Unfortunately, you cannot combine a pragma with a larger query. > Yes, I feared as much. Thanks for the response, Amit ___ sqlite-users mailing list

Re: [sqlite] Using pragma user_version when doing updates

2013-09-17 Thread Richard Hipp
On Tue, Sep 17, 2013 at 7:13 PM, Amit wrote: > Hello, > > I would like to run the following update statement > if pragma user_version == 2. > > How can I incorporate that in this query? > > UPDATE pass_key > SET key = (SELECT textval FROM saved.pass_key b WHERE

[sqlite] Using pragma user_version when doing updates

2013-09-17 Thread Amit
Hello, I would like to run the following update statement if pragma user_version == 2. How can I incorporate that in this query? UPDATE pass_key SET key = (SELECT textval FROM saved.pass_key b WHERE b.field='key') WHERE name="KeyLock"; I've tried using CASE..WHEN..ELSE but it doesn't seem to