SQLite : how to avoid WIDEMO fields ?

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

SQLite : how to avoid WIDEMO fields ?

Post by swierzbicki » Thu 09 Apr 2015 13:10

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 ?

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: SQLite : how to avoid WIDEMO fields ?

Post by CristianP » Fri 10 Apr 2015 06:25

You can use CAST in your SQL expression or data type mapping in UniQuery

Best regards,
Cristian Peta

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: SQLite : how to avoid WIDEMO fields ?

Post by AlexP » Fri 10 Apr 2015 08:48

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;

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Re: SQLite : how to avoid WIDEMO fields ?

Post by swierzbicki » Fri 10 Apr 2015 09:52

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: SQLite : how to avoid WIDEMO fields ?

Post by AlexP » Fri 10 Apr 2015 10:36

You are welcome. Feel free to contact us if you have any further questions.

Post Reply