如何将oracle数据库的sql语句执行结果保存到另一个sql文件中?

如何将oracle数据库的sql语句执行结果保存到另一个sql文件中?,第1张

set feedback off heading off term off\x0d\x0aset pages 0 trim on trims on lines 32767 long 999999\x0d\x0aset echo off\x0d\x0aspool result.sql\x0d\x0aSelect 'alter table '||table_name||allocate extentfrom user_tables where num_rows=0\x0d\x0aspool off\x0d\x0a把以上部分放入一个脚本文件中再执行,会在当前目录下生成你要的文件result.sql

mysql>tee F:\php_demo\mysql\sqltext.txt

Logging to file 'F:\php_demo\mysql\sqltext.txt'

退出

mysql>notee

Outfile disabled.

mysql>\T F:\php_demo\mysql\sqltext.txt

Logging to file 'F:\php_demo\mysql\sqltext.txt'

退出

mysql>\t

Outfile disabled.


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9954672.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存