linux sqlload 管道,SqlLoad 使用

今天有朋友询问:

我们...应用系统很多,它们之间要交换很多数据,目前是以文本方式交换,问题是文本的分隔符号是(|+|),为三个字符,主要是避免数据的混淆.....

这样的文件能够用sqlldr导入么?

我测试了一下,试验证明是可以的,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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值