Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Igor Tandetnik
Patrik Nilsson wrote: > When I perform a select as the following > > select * from repetition where interval>0 and id=617 > > the result is unexpected > > 617|2012-12-23 19:30:46|0|2012-12-23 19:30:46|0|1|1|0 My educated guess is, interval column has a string value

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Patrik Nilsson
Since I have blobs, datetimes, and integers I managed to use the hex-convertion on some integers as well. They are stored as text in my program. I changed the code for the interval integer, so it is inserted as an integer. It seems to work. I don't get this strange kind of selection anymore.

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Larry Brasfield
Patrik Nilsson wrote: After dumping the database I found that the line of insertion looks like this INSERT INTO "repetition" VALUES(617,X'323031322D31322D32332031393A33303A3436',X'30',X'323031322D31322D32332031393A33303A3436',0,1,1,0); Does SQLite manage the insertion with hexadecimal

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Simon Slavin
On 23 Dec 2012, at 8:42pm, Patrik Nilsson wrote: > After dumping the database I found that the line of insertion looks like > this > > INSERT INTO "repetition" >

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Richard Hipp
On Sun, Dec 23, 2012 at 2:51 PM, Patrik Nilsson wrote: > Hi All! > > When I perform a select as the following > > select * from repetition where interval>0 and id=617 > > the result is unexpected > > 617|2012-12-23 19:30:46|0|2012-12-23 19:30:46|0|1|1|0 > What does

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Larry Brasfield
Patrik Nilsson wrote: > What do you get with query > select * from repetition where cast(interval as integer)==0 and > interval>0 "select * from repetition where cast(interval as integer)==0 and interval>0 and id=617" With this I get the same as the strange one. Without "id=617" it is still

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Patrik Nilsson
> What do you get with query > select * from repetition where cast(interval as integer)==0 and > interval>0 "select * from repetition where cast(interval as integer)==0 and interval>0 and id=617" With this I get the same as the strange one. Without "id=617" it is still selected. /Patrik On

Re: [sqlite] strange behavior with integer with where clause

2012-12-23 Thread Larry Brasfield
Patrik Nilsson wrote: When I perform a select as the following select * from repetition where interval>0 and id=617 the result is unexpected 617|2012-12-23 19:30:46|0|2012-12-23 19:30:46|0|1|1|0 It shows a result with "interval" zero, although I requested everything above zero. When I