On 31 May 2015, at 2:22am, Alan Bryan <icemanind9 at gmail.com> wrote:
> SELECT *, Sum(MyField) AS MySumField FROM MyTable > > Now run sqlite3 <database_name> and type the following: > > PRAGMA table_info(MyView); > > You will notice there is no data type for some reason. I think you get datatypes only for exact copies of a source column. Here's my experiment: SQLite version 3.8.5 2014-08-15 22:37:57 Enter ".help" for usage hints. sqlite> CREATE TABLE myTable (intF INTEGER, realF REAL); sqlite> INSERT INTO myTable VALUES (1,1); sqlite> INSERT INTO myTable VALUES (2.0,2.0); sqlite> INSERT INTO myTable VALUES (3,3.0); sqlite> CREATE VIEW myView2 AS SELECT intF,realF,intF+1,realF*realF FROM myTable; sqlite> SELECT * FROM myView2; 1|1.0|2|1.0 2|2.0|3|4.0 3|3.0|4|9.0 sqlite> PRAGMA table_info(myView2); 0|intF|INTEGER|0||0 1|realF|REAL|0||0 2|intF+1||0||0 3|realF*realF||0||0 The only columns which have a datatype are those which are exact copies of source columns. I conclude that PRAGMA table_info() just isn't that clever. Simon.