spool log.txt select count(*) from table; spool off
spool test.txt select * from test spool off 把数据导出到文本文件后,向LOG文件里写导出的记录数。LOG文件里还有其他内容,如果用spool把件数导出到LOG文件的话,LOG文件利的内容就被覆盖掉了。
For UNIX or Linux.spool temp.txt your_sql; spool off host cat temp.txt >> your_file.txt host rm temp.txtFor Windows.spool temp.txt your_sql; spool off host type temp.txt >> your_file.txt host del temp.txt
select count(*) from table;
spool off
select * from test
spool off
把数据导出到文本文件后,向LOG文件里写导出的记录数。LOG文件里还有其他内容,如果用spool把件数导出到LOG文件的话,LOG文件利的内容就被覆盖掉了。
your_sql;
spool off
host cat temp.txt >> your_file.txt
host rm temp.txtFor Windows.spool temp.txt
your_sql;
spool off
host type temp.txt >> your_file.txt
host del temp.txt