Db2 import使用空格作分割符COLDEL0x20报错SQL3017N

问题描述

import操作,待导入文本想使用空格作为分割符,import命令加上了MODIFIED BY COLDEL0x20 ,但是却报错SQL3017N  A delimiter is not valid or is used more than once.

 

重现步骤

$ cat t1.del

Tue Sep 10 00:02:00

Wed Sep 11 00:03:00

Thu Sep 12 00:04:00

$ db2 "create table t1(WEEKDAY char(10), MONTH char(10), MONTHDAY char(10), TRANSTIME char(10))"

DB20000I The SQL command completed successfully

$ db2 "import from t1.del of del MODIFIED BY COLDEL0x20 insert into t1"

SQL3109N The utility is beginning to load data from file "t1.del".

SQL3017N A delimiter is not valid or is used more than once.

SQL3110N The utility has completed processing. "0" rows were read from the

input file.

 

原因分析

空格和换行均不能作为行分割符,IBM信息中心Delimiter considerations for moving data对此有说明:

There are a number of restrictions in place that help prevent the chosen delimiter character from being treated as a part of the data being moved. First, delimiters are mutually exclusive. Second, a delimiter cannot be binary zero, a line-feed character, a carriage-return, or a blank space. As well, the default decimal point (.) cannot be a string delimiter. Finally, in a DBCS environment, the pipe (|) character delimiter is not supported.

 

https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.dm.doc/doc/r0011047.html

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值