Re: [sqlite] select prepared statement always returning SQLITE_DONE

2013-08-02 Thread Kees Nuyt
On Thu, 1 Aug 2013 21:22:23 -0700 (PDT), ngsbioinformat...@gmail.com wrote: >Hi all - I've got sqlite embedded in an iOS app. I have a database with 1 >table, and am creating a prepared select statement with a where clause on 1 >field. In my loop, my order of operations is: sqlite3_bind_text,

Re: [sqlite] proper use of sqlite3_file_control()

2013-08-02 Thread Stephan Beal
On Fri, Aug 2, 2013 at 12:41 AM, Stephan Beal wrote: > Yeah, i found that out the hard way ;) and had to go update my local > sqlite3, but you were half right - i was linking to the wrong one, but i'm > still seeing that behaviour with my fresh build: > Found the problem:

Re: [sqlite] Where Clause

2013-08-02 Thread Eduardo Morras
On Fri, 2 Aug 2013 14:04:40 +0530 techi eth wrote: > At the end of execution I am expecting SET will change the value but it > actually doesn't SET the value due to wrong condition. > > I will check return from sqlite3 & due to success return I am in wrong > assumption.

Re: [sqlite] Query optimization: Checking for existence before performing action

2013-08-02 Thread Simon Slavin
On 2 Aug 2013, at 2:09pm, Igor Tandetnik wrote: > On 8/2/2013 8:14 AM, Simon Slavin wrote: >> >> On 2 Aug 2013, at 10:13am, Jan Slodicka wrote: >> >>> Hi Simon, >>> >>> the solution might look elegant, but it is probably a lot slower. I did not >>> check

Re: [sqlite] Query optimization: Checking for existence before performing action

2013-08-02 Thread Igor Tandetnik
On 8/2/2013 8:14 AM, Simon Slavin wrote: On 2 Aug 2013, at 10:13am, Jan Slodicka wrote: Hi Simon, the solution might look elegant, but it is probably a lot slower. I did not check this particular case, but in the past I found triggers to perform rather badly. I am puzzled.

Re: [sqlite] select prepared statement always returning SQLITE_DONE

2013-08-02 Thread Richard Hipp
On Fri, Aug 2, 2013 at 12:22 AM, wrote: > Hi all - I've got sqlite embedded in an iOS app. I have a database with 1 > table, and am creating a prepared select statement with a where clause on 1 > field. In my loop, my order of operations is: sqlite3_bind_text, >

[sqlite] Regarding data source problem

2013-08-02 Thread Sujay Saboo
Hi, i hv installed sqlite setup for .net framework 4.0. On one machine i can view sqlite in data source bt in another pc same is not showing. Am i missing sumthing. Please suggest. Regards, Sujay Saboo ___ sqlite-users mailing list

Re: [sqlite] Where Clause

2013-08-02 Thread ibrahim
On 02.08.2013 10:14, techi eth wrote: Come across one issue with conditional query execution. Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2; According to my understanding if no ID = 2 is present in table then error should return but it return with SQLITE_OK however Name value is not

[sqlite] select prepared statement always returning SQLITE_DONE

2013-08-02 Thread ngsbioinformatics
Hi all - I've got sqlite embedded in an iOS app. I have a database with 1 table, and am creating a prepared select statement with a where clause on 1 field. In my loop, my order of operations is: sqlite3_bind_text, sqlite3_step, sqlite3_reset. One the first iteration of the loop,

Re: [sqlite] Query optimization: Checking for existence before performing action

2013-08-02 Thread Simon Slavin
On 2 Aug 2013, at 10:13am, Jan Slodicka wrote: > Hi Simon, > > the solution might look elegant, but it is probably a lot slower. I did not > check this particular case, but in the past I found triggers to perform > rather badly. I am puzzled. My solution does not involve any

Re: [sqlite] Where Clause

2013-08-02 Thread Hick Gunter
Please note that you do need to have an explicit transaction in progress. Otherwise the SELECT may count records that no longer exist when the UPDATE starts. -Ursprüngliche Nachricht- Von: techi eth [mailto:techi...@gmail.com] Gesendet: Freitag, 02. August 2013 13:13 An: General

Re: [sqlite] Where Clause

2013-08-02 Thread techi eth
I was checking for Update only if condition will match. In fact it can be any operation like SELECT,INSERT,UPDATE or DELETE I think hint given by you using count() function will do the required. So here If condition matches then count will return nonzero value & based on that I can continue

Re: [sqlite] Where Clause

2013-08-02 Thread Hick Gunter
Please describe in simple words what you are trying to do. UPDATE SET = WHERE Will change the value of in all records of the that satisfy the . You seem to be expecting that the field is changed also in records that do not satisfy the condition. Or perhaps you really want something like:

Re: [sqlite] Where Clause

2013-08-02 Thread techi eth
Is their any Query format which can change the value based on conditional expression is TRUE!!! Thanks.. Techi - On Fri, Aug 2, 2013 at 2:11 PM, Hick Gunter wrote: > The SQL you gave translates to > > "Change the 'Name' field to have the value 'test' in all records where

Re: [sqlite] Query on database back-up:

2013-08-02 Thread techi eth
Thanks.All cases clear except below What happen if other process is not able to complete operation within timeout duration? Cheers - Techi On Fri, Aug 2, 2013 at 2:28 PM, Clemens Ladisch wrote: > > techi eth wrote: > >> 1. "Any database clients wishing to write to the

Re: [sqlite] Query optimization: Checking for existence before performing action

2013-08-02 Thread Jan Slodicka
Hi Simon, the solution might look elegant, but it is probably a lot slower. I did not check this particular case, but in the past I found triggers to perform rather badly. Regards, Jan -- View this message in context:

Re: [sqlite] Query on database back-up:

2013-08-02 Thread Clemens Ladisch
> techi eth wrote: >> 1. "Any database clients wishing to write to the database file while a >> backup is being created must wait until the shared lock is >> relinquished." > > Example 1: Loading and Saving In-Memory Databases will not fulfill > this shortcoming. In-memory databases cannot be

Re: [sqlite] Where Clause

2013-08-02 Thread Roland Wilczek
Hi, You expected the database to perform the assignment on each row WHERE ID = 2. It did exactly this. -- kind regards - Roland Wilczek Am Freitag, 2. August 2013, 14:04:40 schrieb techi eth: > At the end of execution I am expecting SET will change the value but it > actually doesn't SET the

Re: [sqlite] Where Clause

2013-08-02 Thread Hick Gunter
The SQL you gave translates to "Change the 'Name' field to have the value 'test' in all records where the 'ID' field has the value 2". If there is no such record, then SQL has nothing to do and very successfully does exactly nothing. SQL is "set oriented" and update operations on empty sets

Re: [sqlite] Where Clause

2013-08-02 Thread techi eth
At the end of execution I am expecting SET will change the value but it actually doesn't SET the value due to wrong condition. I will check return from sqlite3 & due to success return I am in wrong assumption. On Fri, Aug 2, 2013 at 1:57 PM, Igor Korot wrote: > Hi > Why do

Re: [sqlite] Where Clause

2013-08-02 Thread Igor Korot
Hi Why do you think it should return error? On Aug 2, 2013 1:15 AM, "techi eth" wrote: > Come across one issue with conditional query execution. > > Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2; > According to my understanding if no ID = 2 is present in table then

[sqlite] Where Clause

2013-08-02 Thread techi eth
Come across one issue with conditional query execution. Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2; According to my understanding if no ID = 2 is present in table then error should return but it return with SQLITE_OK however Name value is not changed. Cheers - Techi

Re: [sqlite] Query on database back-up:

2013-08-02 Thread techi eth
Appreciate if I will get clarification. If any of the point out of the scope of mailing list then please mark. Thanks a lot!!! On Wed, Jul 31, 2013 at 6:53 PM, techi eth wrote: > Thanks for answer. > > Let me put my query on point mentioned by comparing historic way of >