Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1350145
  • 博文数量: 112
  • 博客积分: 7112
  • 博客等级: 少将
  • 技术积分: 1299
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-31 16:27
文章分类

全部博文(112)

文章存档

2011年(19)

2010年(20)

2009年(16)

2008年(20)

2007年(37)

分类: Oracle

2007-08-06 17:57:27

                 oracle导数据的用法之sqlldr命令
 
 
新建wma_2007.ctl文件加入
load data
infile 'output1.txt'
append into table tmp_mdn_3
fields terminated by ','
(mdn)
 
把output1.txt里的号码导入tmp_mdn_3表中
sqlldr control=wma_2006.ctl
 
利用Oracle中的Spool缓冲池技术可以实现Oracle数据导出到文本文件。
1、在Oracle PL/SQL中输入缓冲开始命令,并指定输出的文件名:
set colsep' ';                       //##--域输出分隔符
set echo off;                            //##--显示start启动的脚本中的每个sql命令,缺省为on
set feedback off;                        //##--回显本次sql命令处理的记录条数,缺省为on      
set heading off;                         //##--输出域标题,缺省为on
set pagesize 0;                          //##--输出每页行数,缺省为24,为了避免分页,可设定为0。
set linesize 80;                         //##--输出一行字符个数,缺省为80
set numwidth 12;                         //##--输出number类型域长度,缺省为10
set termout off;                         //##--显示脚本中的命令的执行结果,缺省为on
set timing off;           //##--显示每条sql命令的耗时,缺省为off
set trimout on;                          //##--去除标准输出每行的拖尾空格,缺省为off
set trimspool on;                        //##--去除重定向(spool)输出每行的拖尾空格,缺省为off
 spool d:\output.txt
2、在命令行中随便输入你的SQL查询:
例:
select t.mdn from tmp_mdn_1 t
where not exists (select 1 from temp_blacklist t2 where t2.vc2phonenumber = t.mdn);

 ……
3、在命令行中输入缓冲结果命令:
 spool off;
 则系统将缓冲池中的结果都输出到"output.txt"文件中。
 
 
阅读(4804) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~