cancel
Showing results for 
Search instead for 
Did you mean: 

SQL spool

Former Member
0 Kudos

Hi ,

I am trying to save 1000 records through spool but it is not helping me out, what is the best way of doing so. Here is what i am trying to do.

SQL > Spool test.txt;

SQL> select * from table name;

SQL> spool off;

or

SQL > Spool c:\test.txt;

SQL> select * from table name;

SQL> spool off;

But it doesn't save any file. what to do please help.

thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member204746
Active Contributor
0 Kudos

try taking out the ";" in Spool c:\test.txt;

Former Member
0 Kudos

Hi , it is still the same. When i telnet to a unix server and do the spool , i don't have have access to the C:/ drive on unix box, in such a case , is there a way to save the file.

Thnaks

markus_doehr2
Active Contributor
0 Kudos

> Hi , it is still the same. When i telnet to a unix server and do the spool , i don't have have access to the C:/ drive on unix box, in such a case , is there a way to save the file.

There are several options:

- put it on an NFS drive where you have access with your Windows box

- mount a Windows filesystem using SAMBA/CIFS

- use FTP to transfer the file (get it from the Unix machine)

- use scp (or WinSCP) to copy the file

- mail it to your email (mail -s "subject" <addresse> < spool.txt

Markus

anindya_bose
Active Contributor
0 Kudos

Anuroop

Just simplify this/

Open command prompt--> Type "cd Desktop"->sqlplus /nolog->connect /as sysdba--->spool output.txt->select * from table name ( or whatever you want to do)--->spool off;

It will generate a file called output.txt on your server desktop.

Thanks and Regards

Anindya

Former Member
0 Kudos
SQL > Spool c:\test.txt;
SQL> select * from table name;
SQL> spool off;

But it doesn't save any file. what to do please help.

It should work. Make sure you are checking on correct server/location ( just in case you are using remote connections)

sunny_pahuja2
Active Contributor
0 Kudos

Hi,

When you are doing spool on, then it will generate a file <filename>.lst in the directory from where you started sql.

Check space in directory. It must work.

Thanks

Sunny