Problems with passing Binary as a table-valued parameter
I'm using table-valued parameters to pass binary values.
I used SQLBindParameter and passed the values as SQL_C_BINARY, SQL_BINARY, BinarySize, etc. as the arguments, but when I run SQLExecute, I get an error or the result is different from what I expected.
There are two typical cases of error messages.
First
In Binary(40), if the 40-byte value contains a zero in the middle, the subsequent values are terminated.
Secondly
Binary(40) is passed with 40 bytes full, the error message “String or Binary will be truncated” is displayed.
The other datatypes are working fine, CHAR and VARCHAR are also working fine.
Based on this result, I wonder if the value is recognized as a string during the passing process, even though I specified Binary as SQLBindParameter.
Please help...
Translated with www.DeepL.com/Translator (free version)