Re: Conversion problem with cast function
Hi Alberto,
You are right, MySQL converts 258 to 323528 byte sequence before inserting into a BINARY column.
Can you change your application to insert a hex literal instead of integer value to solve this problem? By the way hex literals are allowed in both SQL Server and MySQL.
MySQL:
INSERT INTO tresult VALUES (0x00000102);
You can check that this binary value (bytes 00, 00, 01, 02) was inserted using HEX function:
SELECT HEX(info) FROM tresult;
+-----------+
| HEX(info) |
+-----------+
| 00000102 |
+-----------+
Thanks,
Dmitry Tolpeko
--
SQLines - SQL Server to MySQL Database Migration Tools
http://www.sqlines.com
Subject
Written By
Posted
December 03, 2012 09:25AM
Re: Conversion problem with cast function
December 04, 2012 03:57AM
December 04, 2012 08:45AM
December 05, 2012 01:50AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.