sqlldr加载数据到不同表的问题_SQL SERVER数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

sqlldr加载数据到不同表的问题

作者:黑客防线网安SQL维护基地 来源:黑客防线网安SQL维护基地 浏览次数:0

本篇关键词:问题不同数据POSITION
黑客防线网安网讯:实例讲解sqlldr加载数据到不同表的问题:◆首先我们来创建测试表:D:Orion>sqlplus eygle/eygleSQL*Plus: Release 9.2.0.6.0 - Production on 星期一 11月 11 12::20 2007Copyright (c) 198...

实例讲解sqlldr加载数据到不同表的问题:

◆首先我们来创建测试表:

D:Orion>sqlplus eygle/eygle
SQL*Plus: Release 9.2.0.6.0 - Production on 星期一 11月 11 12::20 2007
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

连接到:

Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
19:53:59 SQL> create table test1 (
19:54:14   2  a1 varchar2(10),
19:54:21   3  a2 varchar2(10),
19:54:26   4  a3 varchar2(10));

表已创建

已用时间:  00: 00: 00.03
19:54:32 SQL> create table test2 (
19:54:35   2  a1 varchar2(10),
19:54:39   3  a2 varchar2(10),
19:54:40   4  a3 varchar2(10));

表已创建

已用时间:  00: 00: 00.04
23:21:42 SQL> exit
从Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production中断开

◆然后我们来测试数据:

D:Orion>cat data.txt
01,KunMing,YunNan
02,BeiJing,BeiJing
02,ShenZhe,ShenZhe
02,TianJin,TianJin
D:Orion>

◆控制文件

D:Orion>cat data.ctl
LOAD DATA
INFILE 'data.txt'
APPEND INTO TABLE test1
WHEN (2) = '1'
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY " " TRAILING NULLCOLS
( a1 POSITION(01:02), a2 POSITION(04:10), a3 POSITION(12:19) )
INTO TABLE test2
WHEN (2) = '2'
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY " " TRAILING NULLCOLS
( a1 POSITION(01:02), a2 POSITION(04:10), a3 POSITION(12:19) )

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-10119-1.html
网站维护教程更新时间:2012-03-21 02:29:54  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer