Error in field data type

Discussion of open issues, suggestions and bugs regarding Virtual Data Access Components for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jjmorlan
Posts: 11
Joined: Mon 31 Aug 2015 12:29

Error in field data type

Post by jjmorlan » Sat 07 Oct 2017 11:47

When in VirtualQuery I use a statement that uses count or sum functions when extracting the field in the field editor it brings me a Memo field. Data type should be Float or numeric type, but extracting ftMemo. Why does this happen?

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Error in field data type

Post by MaximG » Wed 11 Oct 2017 09:53

VirtualQuery is built using the SQLite engine. When the SQLite engine cannot determine the type of the field returned by the query, we create the corresponding Field of the Memo type. In order for such fields to be created with the type required by a developer, you can use DataTypeMapping, a special mechanism provided by our components. You can use this feature both in Design Time with the help of VirtulalQuery Editor, and in Run Time:

Code: Select all

VirtualQuery.DataTypeMap.AddFieldNameRule ('SumResult', ftInteger);
where 'SumResult' is the name of the field returned by the query.

Post Reply