1

How to prevent Squirrel SQL to show concat() of int data types as varbinary in hex format instead of plain text?

For example, SELECT CONCAT(1,2) shows the hex notation 3132 instead of "12" ...

Looking at the MetaData result tab shows that the resulting column type is VARBINARY. How can I force it to be plain text?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Phil
  • 341
  • 4
  • 5
  • how about `concat (cast 1 as char,cast 2 as char)` ? – Abhik Chakraborty May 08 '14 at 13:54
  • Yes this returns `"12"`, but your syntax is wrong. It's select `concat(cast( 1 as char),cast(2 as char))`. However I was looking for a more persistent and less syntax-intensive solution, since a simple `select concat(1,2)` returns in plain text in mysql command-line. – Phil May 09 '14 at 13:21
  • I have also faced the same issue, but not resolved using any of above comments. When used the same query with another client with mysql it worked correctly. – Mandar Pandit Nov 03 '15 at 09:58

1 Answers1

-1

Use the CAST command, for example:

SELECT CAST(CONCAT(1,2) AS CHAR)
JoelC
  • 3,664
  • 9
  • 33
  • 38