如何在sqlldr中倒入多字符分隔符文件

 我来答
huanglenzhi
推荐于2016-05-26 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
采纳数:117538 获赞数:517199
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。

向TA提问 私信TA
展开全部
sqlldr支持多字符分隔符文件导入。
首先看我的数据文件和控制文件:

[oracle@jumper tmp]$ cat data.ctl
load data
into table
TEST
fields terminated by "|+|"
(
T_ID,
T_VOL
)
[oracle@jumper
tmp]$ cat data.txt

20021228000000|+|00120000
20021228000000|+|00130000
20021228000000|+|00140000
20021||8000000|+|00140000
20021++8000000|+|00140000
创建测试表:
[oracle@jumper tmp]$ sqlplus eygle/eygle

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Nov 21 13:21:16 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 -
Production
With the Partitioning option
JServer Release 9.2.0.4.0 -
Production

SQL> create table test
2 (T_ID varchar2(20),
3 T_VOL
varchar2(20)
4 );

Table created.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release
9.2.0.4.0 - Production
With the Partitioning option
JServer Release
9.2.0.4.0 - Production

加载数据:

[oracle@jumper tmp]$ sqlldr eygle/eygle control=data.ctl
data=data.txt

SQL*Loader: Release 9.2.0.4.0 - Production on Tue Nov 21 13:23:53 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Commit point reached - logical record count 5
[oracle@jumper tmp]$ sqlplus
eygle/eygle

SQL*Plus: Release 9.2.0.4.0 - Production on Tue Nov 21 13:23:57 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 -
Production
With the Partitioning option
JServer Release 9.2.0.4.0 -
Production

SQL> select * from test;

T_ID T_VOL
-------------------- --------------------
20021228000000
00120000
20021228000000 00130000
20021228000000 00140000
20021||8000000
00140000
20021++8000000 00140000

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release
9.2.0.4.0 - Production
With the Partitioning option
JServer Release
9.2.0.4.0 - Production

只作了简单验证,不知道复杂情况会不会有问题。
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式