Error in field data type

Error in field data type

Postby 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?
Posts: 9
Joined: Mon 31 Aug 2015 12:29

Re: Error in field data type

Postby 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.
Devart Team
Posts: 787
Joined: Mon 06 Jul 2015 11:34

Return to VirtualDAC