First edit a script file, such as named abc.shspool abc.txt; # # 结果 a a t t t f t = = = =;;;;;;;;;;; Spool off; use @ / opt / abc.sh in SQL> mode, the result is output to abc.txt