On 30 Jun 2018, at 8:35am, Keith Medcalf <kmedc...@dessus.com> wrote:
> You "put" a ieee754 floating point double. Keith, Are you referring to this ? On 30 Jun 2018, at 8:04am, Thomas Kurz <sqlite.2...@t-net.ruhr> wrote: > CREATE TABLE a (col1 STRING); > INSERT INTO a (col1) VALUES ("3.0"); > SELECT * from a; > ---> 3 // this should never happen!! If so, then I disagree with you. The column was defined as STRING. A string was put into it. There is nothing in the above to suggest that the programmer might one day want the value they supplied mutilated. The problem, as far as SQLite is concerned, is that the column should have been declared "TEXT' not STRING. Then it works correctly: SQLite version 3.22.0 2017-12-05 15:00:17 [...] sqlite> CREATE TABLE a (col1 STRING); sqlite> INSERT INTO a (col1) VALUES ("3.0"); sqlite> SELECT * from a; 3 sqlite> DROP TABLE a; sqlite> CREATE TABLE a (col1 TEXT); sqlite> INSERT INTO a (col1) VALUES ("3.0"); sqlite> SELECT * from a; 3.0 But course the dev team cannot correct the understanding of 'STRING' for backward compatibility reasons. And using affinities rather than types means that feeding a string into a numeric column does not generate an error. So the programmer never figured out that using 'STRING' as a type didn't do the right thing. It's a problem with multiple causes. And it cannot be fixed in SQLite3. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users