Spool Error in SQL*Plus [message #482436] |
Thu, 11 November 2010 09:54 |
sparkie
Messages: 2 Registered: November 2010 Location: az
|
Junior Member |
|
|
Am getting error: not spooling currently when executing this code
set heading off pages 0 trimspool on feedback off echo off timing off
col spoolname new_value spoolname
select 'C:\Atlanta_'||to_char(sysdate, 'yymmdd') spoolname from dual
spool '&spoolname'
select '1', 'X' from dual;
spool off
[EDITED by LF: fixed topic title. The original was "Spool Error in PLSQL"]
[Updated on: Thu, 11 November 2010 10:30] by Moderator Report message to a moderator
|
|
|
|
Re: Spool Error in PLSQL [message #482438 is a reply to message #482436] |
Thu, 11 November 2010 10:01 |
cookiemonster
Messages: 13961 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you copy and paste the actual execution from sqlplus:
SQL> set heading off pages 0 trimspool on feedback off echo off timing off
SQL>
SQL> col spoolname new_value spoolname
SQL> select 'C:\Atlanta_'||to_char(sysdate, 'yymmdd') spoolname from dual
2 spool '&spoolname'
3
SQL> select '1', 'X' from dual;
1 X
SQL>
SQL> spool off
not spooling currently
You'll see it treats the spool command as part of the select statement. Try putting a ; at the end of the select statement.
And what has PL/SQL got to do with any of this?
|
|
|
|
Re: Spool Error in PLSQL [message #482445 is a reply to message #482441] |
Thu, 11 November 2010 10:34 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Before your next question, Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Regards
Michel
|
|
|