How can I get a database query reading a varbinary field to return a binary type?
It is currently returning it as a String type, without any casting on my part.
I am using a Database Reader node, reading a varbinary field from a SQL Server with
select binary_field from image_table
I have tried adapting the image example, 01_Data_Access/03_Dattabases/03_Read_and_Write_PNG_Images_in_Databases, pointing it to our SQL server, and the Database Table Selector output gives a String.
I'm using the Microsoft JDBC Driver 4.2 for SQL Server\sqljdbc_4.2\enu\sqljdbc4.jar
Yes, I used it to convert the input string into a binary to load.
The problem is the Database Reader node is returning a varbinary(MAX) type as a string, and not as a binary. Could there be some conversion being done internal to the node so it doesn't return binary fields?
The query statement is simple select * from table, no conversion at the SQL level.
I've created a workflow to demonstrate the problem , please have a look. The database connection would obviously need to be changed to run, but the data is kept so you can see the Database Reader is not coming back with a binary column.
The SQL type VARBINARY is currently not handled explicitly and therefore is mapped to string. It's easy to change though, probably even with the upcoming bugfix release.