Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Insert JSON values into SQL Database (nvarchar / NULL Problem)

Highlighted

Insert JSON values into SQL Database (nvarchar / NULL Problem)

New Contributor

62382-putsql-insertstatement.png

Hello,
I'm new in Nifi and have a problem by inserting JSON values into a SQL Table.
My JSON contains information about TyreDatas. There it is possible that some field are not set. So I need to import a NULL value into SQL Table. But if I use the ReplaceText pattern all NULL values are inserted as a nvarchar "null" value, which can make problems.
F.e. if the LoadIndex isn't set, I get the value 'null' inside the SQL Table.

Do you have an idea how to prevent this?

Thanks for help
Christian


nifi-overview.pngreplaces-sql-statement.pngjsonforimport.png
1 REPLY 1

Re: Insert JSON values into SQL Database (nvarchar / NULL Problem)

New Contributor

Can you attach sample input data and the nifi-flow (export it as XML) ? It would be helpful to understand what you are doing and decide where things could be changed.