First of all be careful with your wording. "datetime" in your case is
not affinity, it's declared datatype. Affinity in both of your tables
is NUMERIC, so it doesn't change.

Changing of declared datatype in CREATE TABLE AS SELECT is intended
and was made in 3.6.15 (look here
http://www.sqlite.org/releaselog/3_6_15.html). It was made to avoid a
mess in a code trying to deal with psychic datatypes containing
spaces, quotes and other special symbols.

Pavel

On Tue, Oct 6, 2009 at 9:46 AM, Artem Avramenko <[email protected]> wrote:
> I have following script:
>
> CREATE TABLE a (d datetime);
> INSERT INTO a insert into('01-01-01');
> CREATE TABLE b AS SELECT d FROM a;
>
> Then I use this sql:
>
> SELECT d FROM b;
>
> In SQLite version 3.6.4 the "datetime" affinity is persisted, but from 
> version 3.6.16
> (maybe earlier) the affinity is lost (sqlite3_column_decltype returns "NUM")
>
> For first table (SELECT d FROM a) the "datetime" is returned in all SQLite 
> versions.
>
> Please fix this.
>
>
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to