8

SQLCL is exactly what I need, but I've a big difficulty on one little thing :

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

So I'm using the pipe method with SQLCL in a 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's working (no errors in console) but, impossible to find the file export.csv : when I change the destination c:\... it's working too but impossible to find the created file. It's working fine with SQL Developer and the file is created on my dekstop, so I don't understand why it's not the same case for SQLCL.

4

1 回答 1

1

我从 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

感谢 Gaz in Oz

于 2017-11-06T12:45:40.783 回答