Home » Other » Client Tools » Spool without SQL Statement and Commands in PLSQL
Spool without SQL Statement and Commands in PLSQL [message #487948] Mon, 03 January 2011 13:48 Go to next message
KoolK
Messages: 2
Registered: January 2011
Junior Member
I have a PLSQL script.
sqlplus 
$DB_ACCT << EOSQL
       set heading off
       set termout off
       set pagesize 0
       set linesize 35
       set feedback off
       set serveroutput off
              spool FILE.txt

              Select col_with_a||col_with_b||col_with_c from alphabet_table;
             
              spool off;
                
        exit;
EOSQL



My output in FILE.txt looks like this


SQL>
SQL> Select col_with_a||col_with_b||col_with_c from
2 alphabet_table;
abc
abc
abc
abc
abc
abc
abc
SQL>
SQL> spool off;

I tried several options by putting set echo off, etc.
What do I include in the sql script to get the output as :

abc
abc
abc

without the SQL prompt and the statement, and the spool off command?

Re: Spool without SQL Statement and Commands in PLSQL [message #487949 is a reply to message #487948] Mon, 03 January 2011 14:04 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
bcm@bcm-laptop:~$ cat a.sql 
set term off echo off pages 0
spool a.lis
select a from t2;
spool off
exit
bcm@bcm-laptop:~$ sqlplus -s user1/user1 @a.sql
bcm@bcm-laptop:~$ cat a.lis
         1                                                                      
         2                                                                      
         3                                                                      
         4                                                                      


Re: Spool without SQL Statement and Commands in PLSQL [message #487959 is a reply to message #487949] Mon, 03 January 2011 17:37 Go to previous message
KoolK
Messages: 2
Registered: January 2011
Junior Member
Thank you, BlackSwan, for your help.
Previous Topic: Error: "ORA-00900: invalid SQL statement" after executing procedure
Next Topic: Bulk collect
Goto Forum:
  


Current Time: Tue Apr 16 10:20:08 CDT 2024