Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

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-...