Originariamente inviato da nicki
Il concat non funziona:
codice:
SQLite error no such function: concat
Per concatenare stringhe bisogna || e non + che restituisce la somma intera. Infatti così ho risolto:
SELECT * FROM tbl_veicoli WHERE targa LIKE '%'||:targa||'%'
riferimenti:
http://www.sqlite.org/datatypes.html punto 4.0
[...]
4.0 How SQLite Determines Datatypes
For SQLite version 2.6.3 and earlier, all values used the numeric datatype. The text datatype appears in version 2.7.0 and later. In the sequel it is assumed that you are using version 2.7.0 or later of SQLite.
For an expression, the datatype of the result is often determined by the outermost operator. For example, arithmetic operators ("+", "*", "%") always return a numeric results. The string concatenation operator ("||") returns a text result. And so forth. If you are ever in doubt about the datatype of an expression you can use the special typeof() SQL function to determine what the datatype is. For example:
sqlite> SELECT typeof('abc'+123);
numeric
sqlite> SELECT typeof('abc'||123);
text
[...]
Ciao e grazie dell'aiuto!