> Is there a way to give such columns a type anyway? I guess you aware that columns in SQLite doesn't have types? They only have "declared type" (which is arbitrary string used in CREATE TABLE statement) and affinity. OTOH values in each row have types. And neither "declared type" nor affinity don't prevent column to contain values of any type at all. And I bet values in your view are reported to have appropriate type although columns don't have declared type. Which function return to you NULL type?
Pavel On Mon, May 3, 2010 at 1:14 PM, Stefan Keller <sfkel...@gmail.com> wrote: > I have a question regarding VIEWs in SQLite: > > It looks like if SQLite simply copies the column type from the > original table into the corresponding view column. And I know SQLite > implements some 'loose column typing'. That's ok so far. > > But in SQLite if a view column comes from a function result or some > computation, then the column type is NULL...!? It's not taking the > result-type as mentioned in the manual > (http://www.sqlite.org/lang_select.html) - even when I try to do a > CAST in the projection clause, like this: > > SELECT id, name, CAST(salary + 10 AS INTEGER) "salaryplus10" FROM mytable; > > I mean that a VIEW should behave like a (read only) TABLE in any case. > => Is there a way to give such columns a type anyway? > > Yours > -S. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users