Re: [sqlite] CAST AS STRING always returns 0 for STRING columns

2018-09-05 Thread Keith Medcalf
s [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Ben Caine >Sent: Tuesday, 4 September, 2018 08:31 >To: sqlite-users@mailinglists.sqlite.org >Subject: [sqlite] CAST AS STRING always returns 0 for STRING columns > >CAST AS STRING always returns 0 for columns that a

Re: [sqlite] CAST AS STRING always returns 0 for STRING columns

2018-09-05 Thread Jay Kreibich
> On Sep 4, 2018, at 9:30 AM, Ben Caine 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 > > Steps to

[sqlite] CAST AS STRING always returns 0 for STRING columns

2018-09-05 Thread Ben Caine
CAST AS STRING always returns 0 for columns that are already of STRING type. 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