Skip to main content
Question

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

  • October 19, 2016
  • 6 replies
  • 43 views

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

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

jan
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • 50 replies
  • 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
  • 8392 replies
  • 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
Celebrity
  • 7843 replies
  • October 20, 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.

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
  • 50 replies
  • October 20, 2016

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


david_r
Celebrity
  • 8392 replies
  • October 20, 2016

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
Celebrity
  • 7843 replies
  • October 20, 2016

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.