Re: [sqlite] error in sum function

2010-07-20 Thread Max Vlasov
SQLite Expert (which I use extensively in the Pro version) enforces > displaying types as declared. So if you declare your column as INTEGER > (or INT, ...) then it will display integers regardless of the actual > individual data type using common conversions. This is a side effect > of the Delph

Re: [sqlite] error in sum function

2010-07-15 Thread Tim Romano
Indeed, Igor, it is documented behavior, but my point was to reply to the OP, who had written ruefully about SQLite's laissez-faire approach to datatypes. For the OP's benefit, I wanted to demonstrate the behavior, show what can be done with CAST, and then finally to show what can be done with CAST

Re: [sqlite] error in sum function

2010-07-15 Thread Igor Tandetnik
Tim Romano wrote: > Ignore the typo: > > should be 2 | 2.2 > > > As someone who tends to make typogarphical errors, I do like forums with > post-editing capabilities much better than mailing lists. I don't. While this capability can be used benignly - fixing a typo or two - too often I see it

Re: [sqlite] error in sum function

2010-07-15 Thread Igor Tandetnik
Tim Romano wrote: > So it would appear that if the numeric value to be inserted can be coerced > to INTEGER without loss, it will in fact become an INTEGER, otherwise it > stay what it was, REAL. ..., the behavior that is amply documented at http://sqlite.org/datatype3.html -- Igor Tandetnik __

Re: [sqlite] error in sum function

2010-07-14 Thread Tim Romano
Ignore the typo: should be 2 | 2.2 As someone who tends to make typogarphical errors, I do like forums with post-editing capabilities much better than mailing lists. Regards Tim Romano Swarthmore PA ___ sqlite-users mailing list sqlite-users@sqlite.or

Re: [sqlite] error in sum function

2010-07-14 Thread Tim Romano
I tried this in SQLite Manager for Firefox. CREATE TABLE "PRODUCTS" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE , "product" TEXT, "rank" INTEGER) insert into products (product, rank) values ('gizmo', 1.0) insert into products (product, rank) values ('widget', 2.0) insert into produ

Re: [sqlite] error in sum function

2010-07-14 Thread Bogdan Ureche
> > > SQLite Expert (which I use extensively in the Pro version) enforces > displaying types as declared. So if you declare your column as INTEGER > (or INT, ...) then it will display integers regardless of the actual > individual data type using common conversions. This is a side effect > of the

Re: [sqlite] error in sum function

2010-07-14 Thread Riccardo Cohen
I understand, thanks a lot Jean-Christophe Deschamps wrote: > Ricardo, > >> I have typeof(basket)=real in all records ... >> I just see now that all data are float numbers in the text file that was >> used for inserting rows, and did not notice this because SqliteExpert >> show only ints ! > >

Re: [sqlite] error in sum function

2010-07-14 Thread Simon Slavin
On 14 Jul 2010, at 2:19pm, Riccardo Cohen wrote: > I have typeof(basket)=real in all records ... > I just see now that all data are float numbers in the text file that was > used for inserting rows, and did not notice this because SqliteExpert > show only ints ! > > I understand that sqlite a

Re: [sqlite] error in sum function

2010-07-14 Thread Jean-Christophe Deschamps
Ricardo, >I have typeof(basket)=real in all records ... >I just see now that all data are float numbers in the text file that was >used for inserting rows, and did not notice this because SqliteExpert >show only ints ! SQLite Expert (which I use extensively in the Pro version) enforces displayi

Re: [sqlite] error in sum function

2010-07-14 Thread Riccardo Cohen
I have typeof(basket)=real in all records ... I just see now that all data are float numbers in the text file that was used for inserting rows, and did not notice this because SqliteExpert show only ints ! I understand that sqlite accepts data that are not exactly in declared format (other usu

Re: [sqlite] error in sum function

2010-07-14 Thread Max Vlasov
Riccardo, please do the following query select typeof(basket) as tp FROM Data WHERE tp<>"integer" as you may know sqlite accepts any value regardless of your desired type, so you possible could have inserted a real value not knowing about it. This query will probably show the rows with such valu

[sqlite] error in sum function

2010-07-14 Thread Riccardo Cohen
Hello I've been using sqlite in many projects (thanks for providing it) and found today someting strange with sum function I have a simple database: CREATE TABLE data (irisid char(9),postid varchar(20),basket integer); CREATE INDEX irisididx on data (irisid); CREATE INDEX postididx on data (post