问题描述:
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.