Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Simon Davies
On 1 March 2012 18:43, Don V Nielsen wrote: > I think Simon's solution is in error, and Igor's is correct.  In Simon's > case, Slevel will be set to 1 if price1 is greater than 30. It will be set to 2, as required by OP. > However, the > original c function would set

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Don V Nielsen
Ya know, if you ever wanted to deviate from the SQL standard, a handy upgrade to the CASE statement would permit split conditions on the case and when statement, as in: Case price1 when > 12 then 1 when > 30 then 2 else 0 end dvn On Thu, Mar 1, 2012 at 12:43 PM, Don V Nielsen

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Don V Nielsen
I think Simon's solution is in error, and Igor's is correct. In Simon's case, Slevel will be set to 1 if price1 is greater than 30. However, the original c function would set Slevel to 2 because price1 is greater than 12 and it is greater than 30. Two increments of i are executed in that

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Igor Tandetnik
YAN HONG YE wrote: > I have a sqlite database named bb: > >> NamePrice1Price2Slevel >> A123 231 NULL >> A22212 NULL >> A3 21223 NULL > > My question is: > I want to update

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Simon Davies
On 1 March 2012 08:44, YAN HONG YE wrote: > I have a sqlite database named bb: > >> Name    Price1    Price2    Slevel >> A1        23             231          NULL >> A2        22            12             NULL >> A3       21            223           NULL > > My question is: