Skip to main content
Question

How can I spool SQL query log to a file using SQLExecutor?


jan
Contributor
Forum|alt.badge.img+1
  • Contributor

6 replies

jan
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • October 19, 2016

 

example of how I'd like to spool an sql statment to a file:

 

spool "C:\\Users\\test.txt"

 


david_r
Celebrity
  • October 19, 2016

You could construct the SQL to execute in an attribute (or a private parameter) and send the query to the Logger before the SQLExecutor.


takashi
Influencer
  • October 20, 2016
david_r wrote:

You could construct the SQL to execute in an attribute (or a private parameter) and send the query to the Logger before the SQLExecutor.

Agreed. The AttributeFileWriter might also be an option if you want to write the SQL statement only. e.g.

 


jan
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • October 20, 2016

I don't quite get this! It does not log the result of the query ?


david_r
Celebrity
  • October 20, 2016
jan wrote:

I don't quite get this! It does not log the result of the query ?

What do you want to log, the query or the results?

 

 


takashi
Influencer
  • October 20, 2016
jan wrote:

I don't quite get this! It does not log the result of the query ?

Naturally it will not save the result from the query. It just saves the SQL statement into a file.

 

Perhaps did you mean the Oracle SPOOL command? If so, unfortunately it seems that there is no way to execute the command with the SQLExecutor. Consider using the CSV writer, if you want to save the query result into a text file.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings