通常情况下,我们使用SPOOL方法,将数据库中的表导出为文本文件的时候会采用两种方法,如下述:

  • 方法一:采用以下格式脚本
set colsep ‘|'; –设置|为列分隔符
set trimspool on;
set linesize 120;
set pagesize 2000;
<code>set newpage 1;
set heading off;
set term off;
set num 18;
set feedback off;
spool 路径+文件名;
select * from tablename;
spool off;</code>
  • 方法二:采用以下脚本
set trimspool on
set linesize 120
set pagesize 2000
set newpage 1
set heading off
set term off
spool 路径+文件名
select col1||','||col2||','||col3||','||col4||'..' from tablename;
spool off

示例:

#!/bin/bash
result=$(sqlplus -s 'scott/tiger@dbname'&lt;&lt;EOF
spool test.txt
set pages 0 
set feed off
set heading off;
set feedback off;
set verify off;
set linesize 1000;
SELECT * FROM a where =***;
spool off
EOF
)
echo $result

4 条评论

79clubapp · 2025-12-19 20:07

Downloaded the 79clubapp, and I’m already hooked! The app is super user-friendly, and I love that I can play all my favorite games right from my phone. Recommend it if you want some quick fun. Try it out here: 79clubapp

cratosroyalbets · 2025-12-24 10:48

Cratosroyalbets… I’ve been on that site lately. Decent odds, cool interface. Anyone else tried their slots? Worth a punt, I reckon. cratosroyalbets

ph22login · 2026-01-04 07:23

Really insightful article! It’s great to see platforms like PH22 prioritizing quick, secure deposits with options like GCash – makes responsible gaming easier. Check out ph22 login download apk for a seamless experience and remember to play within your limits! 👍

bk8casino · 2026-01-14 00:41

bk8casino https://www.bk8casinovs.com

回复 cratosroyalbets 取消回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注