我想在 Oracle 11g 中使用假脱机功能。
我希望将整个输出假脱机到一个文件中,并将输出的子集假脱机到一个单独的文件中。
在下面的示例中,我想temp_1.txt
包含来自 A、B、C、D 和 E 的数据
在temp_2.txt
我只想要 D 的数据。
sqlplus user/pass@inst
spool on temp_1.txt
select * from A;
select * from B;
select * from C;
spool on temp_2.txt
select * from D;
spool off temp_2.txt
select * from E;
exit;
注意:-由于这是非常旧的遗留代码,我无法为 D 编写单独的 sqlplus 会话或重新排序选择。