Page 1 of 1
SQLite : how to avoid WIDEMO fields ?
Posted: Thu 09 Apr 2015 13:10
by swierzbicki
Hello,
I need to concatenate some fields :
Code: Select all
SELECT
trim(Trim(Nom_Pilote || ' ' || Prenom_Pilote) || ' ' || '(' || Id_Pilote || ')') as Nom_Pilote
FROM
Pilotes
order by
Nom_Pilote
I'm getting an WIDEMEMO field type. How can I get an string type again ?
Re: SQLite : how to avoid WIDEMO fields ?
Posted: Fri 10 Apr 2015 06:25
by CristianP
You can use CAST in your SQL expression or data type mapping in UniQuery
Best regards,
Cristian Peta
Re: SQLite : how to avoid WIDEMO fields ?
Posted: Fri 10 Apr 2015 08:48
by AlexP
Hello,
When using concatenation, SQLite returns the Unknown data type, therefore we map fields of this type to ftWideMemo. You can use the DataTypeMapping technology to map the field type to a required type.
Code: Select all
UniQuery.DataTypeMap.AddFieldNameRule('Nom_Pilote', ftWideString);
UniQuery.Open;
Re: SQLite : how to avoid WIDEMO fields ?
Posted: Fri 10 Apr 2015 09:52
by swierzbicki
Hello,
@ChristianP
You can use CAST in your SQL expression or data type mapping in UniQuery
I've tried this but field type is still maped to ftWideMemo.
@AlexP
When using concatenation, SQLite returns the Unknown data type, therefore we map fields of this type to ftWideMemo. You can use the DataTypeMapping technology to map the field type to a required type.
That did the trick.
Tank you to both of you
Re: SQLite : how to avoid WIDEMO fields ?
Posted: Fri 10 Apr 2015 10:36
by AlexP
You are welcome. Feel free to contact us if you have any further questions.