varbinary in MySql

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
chkaufmann
Posts: 82
Joined: Sat 01 Jul 2006 11:42

varbinary in MySql

Post by chkaufmann » Thu 28 Jul 2011 13:10

Hi,

I try to read from a Mysql table with varbinary(255) columns.

The fieldtype is set to ftLargeint in the TUniQuery field.

Is this a mistake in UniDac? Or do I have to set any special option for this?

cu Christian

AndreyZ

Post by AndreyZ » Thu 28 Jul 2011 13:50

Hello,

Please specify the following:
- the exact SQL statement you are using in the TUniQuery component;
- the exact version of MySQL server;
- the exact version of UniDAC. You can learn it from the About sheet of TUniConnection Editor.

chkaufmann
Posts: 82
Joined: Sat 01 Jul 2006 11:42

Post by chkaufmann » Fri 29 Jul 2011 08:54

I found the solution:

query.SpecificOptions.Values['BinaryAsString'] := 'False';

then I get VARBINARY as binary fields.

cu Christian

AndreyZ

Post by AndreyZ » Mon 01 Aug 2011 07:41

The BinaryAsString property is used to specify a method of representation of the BINARY and VARBINARY fields. If it is set to True, these fields will be represented as string fields, otherwise, as TBytesField and TVarBytesField correspondingly. In your first post you wrote that the VARBINARY fields were detected as ftLargeint fields. Can you reproduce such UniDAC behaviour? If yes, please provide me all the information I asked in my previous post.

chkaufmann
Posts: 82
Joined: Sat 01 Jul 2006 11:42

Post by chkaufmann » Wed 03 Aug 2011 05:17

AndreyZ wrote:In your first post you wrote that the VARBINARY fields were detected as ftLargeint fields. Can you reproduce such UniDAC behaviour?
Using "BinaryAsString" option, the DataType for VARBINARY is as expected (ftVarBytes).

cu Christian

Post Reply