Bug #92429 When using SQL_C_WCHAR with SQLGetData, binary data is not returned as hex.
Submitted: 14 Sep 2018 21:28 Modified: 18 Sep 2018 10:41
Reporter: Kari Heinola Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:8.00.12.00 UNICODE OS:Microsoft Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any

[14 Sep 2018 21:28] Kari Heinola
Description:
When using SQL_C_WCHAR with SQLGetData, binary data is not returned correctly as hex. Using SQL_C_CHAR with SQLGetData, binary data is returned as hex.

Seems like web post describes the same issue:
https://stackoverflow.com/questions/43846489/sqlbindcol-sql-varbinary-column-to-sql-c-wcha...

How to repeat:
Use call like below to get binary data:
SQLGetData(hStmt, (SQLUSMALLINT)(i + 1), SQL_C_WCHAR, resultData, BUFF_SIZE, &outlen)
[18 Sep 2018 10:41] Bogdan Degtyariov
The bug is verified.
Accordingly to ODBC Specs it should convert binary data to hexacecimal representation:

https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/sql-to-c-binary?view=sql-se...