If you've used a varbinary field to store data, such as an encrypted password, you mind find that the JDBC Connector (used by ColdFusion) falls short when returning the value.

If you cast the value as a char before returning it, that should resolve the issue. i.e.

select user_id, user_username, cast(aes_decrypt(user_password, 'mykey') as CHAR) as user_password
from user

 

Note: This approach also comes in handy when the JDBC / ColdFusion connector decides to arbitrarily return a result column as a BINARY field (often the case when using the GROUP_CONCAT function).

Tags:

1 Comment

  1. Now just discovered, there also seems to be an issue with TinyInt columns. Casting these as CHAR also seems do to do the trick, as wrong as that seems!

Leave a Reply

Your email address will not be published. Required fields are marked *