How to output oracle sql result into a file in windows?

后端 未结 5 684
旧时难觅i
旧时难觅i 2020-12-13 13:32

I tried

select * from users 
save D:\\test.sql create;

But SQL plus gives me \"no proper ended\" How to specify path in oracle sql in windo

5条回答
  •  余生分开走
    2020-12-13 14:09

    Having the same chore on windows 10, and windows server 2012. I found the following solution:

    echo quit |sqlplus schemaName/schemaPassword@sid @plsqlScript.sql > outputFile.log
    

    Explanation

    echo quit | send the quit command to exit sqlplus after the script completes

    sqlplus schemaName/schemaPassword@sid @plsqlScript.sql execute plssql script plsqlScript.sql in schema schemaName with password schemaPassword connecting to SID sid

    > outputFile.log redirect sqlplus output to log file outputFile.log

提交回复
热议问题