> On Sep 4, 2018, at 9:30 AM, Ben Caine <[email protected]> wrote:
> 
> CAST AS STRING always returns 0 for columns that are already of STRING type.

“STRING” is not a known type affinity.  Use “TEXT”

https://www.sqlite.org/lang_expr.html#castexpr 
<https://www.sqlite.org/lang_expr.html#castexpr>



> 
> Steps to reproduce:
> 
> sqlite> CREATE TABLE A(col1 STRING);
> sqlite> INSERT INTO A VALUES('asdf');
> sqlite> SELECT CAST(col1 AS STRING) FROM A;
> 0
> 
> We are generating SQL code programmatically, and it would be useful to not
> have to special-case casting based on column type.
> -- 
> --
> 
> Ben Caine | Software Engineer | Verily
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to