output oracle sql query result to file


SQL*Plus: Release – Production on Sun Sep 21 16:32:13 2008


Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.

Enter user-name: xxxxx

Enter password: 

Connected to:

Oracle Database 10g Enterprise Edition Release – 64bit Production

With the Partitioning, OLAP and Data Mining options


SQL> spool sql.lst

SQL> select * from academic;

     ACNUM    DEPTNUM FAMNAME              GIVENAME             INITIALS

———- ———- ——————– ——————– ———-

** rows selected.

SQL> spool off


 sql.lst is saved at your home directory.