I have a .bat file which looks like this:
start C:\sqlcl-latest\sqlcl\bin\sql javi/pwd@tnsname @"mypath1"
The script it calls looks like this:
select 1 from dual;
select 2 from dual;
exit;
Is there any way to log everything in the cmd and the sqlcl console into a file instead/in addition to being printed in stdout?
I have tried the below, but it creates an empty log file:
start C:\sqlcl-latest\sqlcl\bin\sql javi/pwd@tnsname @"mypath1" > mylog.txt
I don't have SQLCL, but this (redirection to file) should (at least, I hope so) work at operating system command prompt.
myfile1.sql:
myfile2.sql:
mypath1.sql:
mybat.bat:
Running the
mybat.bat
at the command prompt:There's no output to screen; everything is contained in
mylog.txt
file so - let's check it: