output oracle sql query result to file

[email protected]#~>sqlplus

SQL*Plus: Release 10.2.0.3.0 – 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 10.2.0.3.0 – 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.