SQLCL Batch Scripting: Auto Join + EXPORT CSV

SQLCL is exactly what I need, but I have a big difficulty in one little thing:

I want to make a script (batch file) with automatic connection and right after EXPORT CSV (on the remote desktop: not on the server).

So, I use the pipe method with SQLCL in the batch file:

echo SET SQLFORMAT CSV < echo SPOOL export.csv < echo SELECT COUNT(*) FROM ARTICLE; < echo SPOOL OFF | C:\Work\Soft\sqlcl\bin\sql.exe login/ passwd@xxx.xxx.xxx.xxx :1521/DB.SCH 

It works (there are no errors in the console), but it is impossible to find the export.csv file: when changing the destination c:\... it also works, but it is impossible to find the created file. It works fine with SQL Developer, and the file is created on my dekstop, so I don’t understand why this is not the same case for SQLCL.

+7
scripting batch-file export-to-csv sqlcl
source share
1 answer

I had an answer from the oracle platform:

 @echo off echo SET SQLFORMAT CSV ^& ^ echo SET FEEDBACK OFF ^& ^ echo SPOOL export.csv ^& ^ echo SELECT COUNT^(*^) FROM dual ^& ^ echo SPOOL OFF |  C:\Work\Soft\sqlcl\bin\sql.exe sql -noupdates -s -l login/ passwd@xxx.xxx.xxx.xxx :1521/DB.SCH 

Thanks Gaz in Oz

0
source share

All Articles