Support Questions
Find answers, ask questions, and share your expertise

Execute SQL process result without modification

Highlighted

Execute SQL process result without modification

New Contributor

From oracle I get a finished xml file using a select

select
xmlelement (
  etc.
I do not need to convert the received data to anything, just save it to a local disk.
But I can’t figure out how to do this.

Ideally, I see it like this "ExecuteSQL" →"PutFile"

 

3 REPLIES 3
Highlighted

Re: Execute SQL process result without modification

Cloudera Employee

Hi,

 

Sorry I don't get the question.

This should work:

 

Ideally, I see it like this "ExecuteSQL" →"PutFile"

 

Assuming based on comment you are getting a finished xml.

Highlighted

Re: Execute SQL process result without modification

New Contributor

I apologize, maybe I did not describe the problem in sufficient detail.
With such a scheme, I get the file in the output as in the screenshot, spurious data appears in it.

flow.jpgExecuteSQL.jpgPutFile.jpg

Invalid xml file

resultfile.jpg

At the moment, I am forced to use a ReplaceText processor to remove unnecessary data, but it is very slow.

Highlighted

Re: Execute SQL process result without modification

Cloudera Employee

That data seems like avro which is typically how the records are returned from a DB.

You should send the FlowFile to a ConvertRecord processor and set it as an avro reader and an xml writer.

This article has good information on how to do that.

https://community.cloudera.com/t5/Community-Articles/XML-Record-Writer-in-Apache-NiFi-1-7-0/ta-p/248...

Don't have an account?