Support Questions

Find answers, ask questions, and share your expertise
Announcements
We’ve updated our product names and community labels - click here for full details

QueryDatabaseTableRecord converting varbinary column to text?

avatar
Frequent Visitor

Edit: Tried using CSVWriter, XMLWriter and AvroWriter. All NG.

 

Nifi Version2.5.0
ProcessorQueryDatabaseTableRecord 
Drivercom.microsoft.sqlserver.jdbc.SQLServerDriver

 

I have a requirement to pull varbinary data from a table however the  output is always text.  I expect a result starting with 0x. According to the jdbc driver within nifi, varbinary is supported however I see it gets converted to bytes. Is there a way to maintain the 0x format for the writer? 

Notes

1 ACCEPTED SOLUTION

avatar
Frequent Visitor

I have resolved this by forcing a CONVERT with a style of 1 to ensure binary output in the sql query with a 0x primer.  Documentation here: https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-... 

View solution in original post

1 REPLY 1

avatar
Frequent Visitor

I have resolved this by forcing a CONVERT with a style of 1 to ensure binary output in the sql query with a 0x primer.  Documentation here: https://learn.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql?view=sql-server-...