MySQL Forums
Forum List  »  Microsoft SQL Server

Re: Conversion problem with cast function
Posted by: Alberto Molero
Date: December 04, 2012 08:45AM

Don't work for me ( your solution work, but not for me in this case :D )
I need that the HEX value have a fixed length.
Sample:

/*tResult is a table that contains only one column. (info varbinary(8000))*/
Insert Into tresult
Select Concat(Convert(ifnull(customerName, ''), binary(20)),
Convert(ifnull(customerID, 0), binary(4))
From Customers

/*
customerName Varchar(20) - THE CONVERSION WORK FINE
customerID Integer - THE CONVERSION DOESN'T WORK
*/

The main problem of your solution is that i can't fix the length of the value.

Options: ReplyQuote


Subject
Written By
Posted
Re: Conversion problem with cast function
December 04, 2012 08:45AM


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.