0

Problem Statement : I am exporting the output of sql query (executed via batch file) of AWS RDS instance into a csv file.

Work done till now : I have created the batch file in which I am giving the below command : Code 1 : sqlplus -s username/password@instance_name @test3.sql > output.csv

where test3.sql is a input file output.csv is an output file Code 2 :

set head off
set feed off
set pagesize 0
spool C:\Users\-sysop-ansimr\Desktop\a.csv
select * from task;
spool off
set head on
set feed 6
quit
Begginer
  • 317
  • 2
  • 3
  • 13
  • So what problem are you encountering? What is the content of test3.sql? (can you debug code that you cannot see? Neither can we). Instead of redirecting stdout, consider use of the sqlplus 'spool' command. – EdStevens Apr 23 '19 at 13:22
  • I tried using spool option but that is also not working. I have updated my question with spool code. Please have a look. – Begginer Apr 24 '19 at 10:45
  • I'm sorry, but "not working" is not a known error message. Have you read this: https://stackoverflow.com/questions/643137/how-do-i-spool-to-a-csv-formatted-file-using-sqlplus – EdStevens Apr 24 '19 at 11:59

0 Answers0