Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

How to handle multiple attibutes in NiFi flow?

Explorer

Hello all and @mburgess

I am able to extract attributes from XML data using GetFile>SplitXml> EvaluateXQuery processor. Now, I have many attributes that I need to put inside the SQLData.

xml_perse.JPGxml_perse_1.JPG

In my database I have a table with (block_id,kp_begin,kp_end) header. So, can anyone please tell me how can we insert the collected dynamic attributes into the table, which processor should I use and what will be the configuration?

3 REPLIES 3

Super Guru

Can you share a snippet of what the original XML looks like? I'm wondering if you need the SplitXML or not. Also it looks like you have a number of "records" in each split XML file, so you probably don't want to put all the values into attributes. Instead, consider PutDatabaseRecord with an XMLReader, if there are multiple entries in the XML that each correspond to a row in the database, PutDatabaseRecord with XMLReader should do all the work for you.

Explorer

Hello mburgees,

Thanks for your quick reply.Here is the xml snippet. Yes, you are correct,  I have a number of records in the XML out of which I just want Block_Id, Kp_Begin, Kp_End. Can you please tell me what will be the configuration in  PutDatabaseRecord that case

xml_perse_3.JPG

 

 

 

Explorer

@mburgess Currently, I am facing this error. Please have a look

 

xml_perse_4.jpg

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.