[Oracle] SQL script with SPOOL command
Arch
-
Arch -
Arch -
Hello,
I am currently creating an SQL script using the command 'SPOOL <file name="">', my SQL, and then 'SPOOL OFF'.
I should mention that my query works (tested separately).
But now I'm getting an error [Err] ORA-00922: missing or invalid option and I think it's a syntax issue (I get this error when it encounters a ';', should I not include it at all?).
Thank you for your help!</file>
I am currently creating an SQL script using the command 'SPOOL <file name="">', my SQL, and then 'SPOOL OFF'.
I should mention that my query works (tested separately).
But now I'm getting an error [Err] ORA-00922: missing or invalid option and I think it's a syntax issue (I get this error when it encounters a ';', should I not include it at all?).
Thank you for your help!</file>
1 answer
-
Hello,
copy/paste your script here and you will get a quick response.
otherwise it's:
SPOOL F:\my_log.txt
or
SPOOL my_log.txt
SELECT ....
FROM
WHERE.... ;
SPOOL OFF
http://www.dba-ora.fr/
--
Experience is what everyone calls their mistakes.-
-
-
-
SET ECHO OFF
works only in scripts, not in interactive mode.
You need to call the script instead of executing it in interactive mode
SQLPLUS login/password@tns @YOUR_SCRIPT.SQL
http://www.dba-ora.fr -
-