SQL*加载程序无法识别分隔符“¥”

SQL*Loader does not recognize delimiter "¥"

尝试加载带有 ¥ 分隔符的 UTF-8 文件时,它在找到字符时不会分隔字段。我们从超过列大小的值中得到一个 ORA-12899 错误,因为它试图将整行放入第一列。

在 UTF-8 中,¥¥ (C2A5),但它似乎试图找到 C2C2A5。

数据库设置为

NLS_LANGUAGE    SPANISH
NLS_TERRITORY   SPAIN
NLS_CURRENCY    ?
NLS_ISO_CURRENCY    SPAIN
NLS_NUMERIC_CHARACTERS  ,.
NLS_CHARACTERSET    WE8ISO8859P15
NLS_CALENDAR    GREGORIAN
NLS_DATE_FORMAT DD/MM/RR
NLS_DATE_LANGUAGE   SPANISH
NLS_SORT    SPANISH
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT    DD/MM/RR HH24:MI:SSXFF
NLS_TIME_TZ_FORMAT  HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD/MM/RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY   ?
NLS_COMP    BINARY
NLS_LENGTH_SEMANTICS    BYTE
NLS_NCHAR_CONV_EXCP FALSE
NLS_NCHAR_CHARACTERSET  AL16UTF16
NLS_RDBMS_VERSION   11.2.0.3.0

我们尝试过:

NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
NLS_LANG=SPANISH_SPAIN.WE8MSWIN1252

我们是 运行 SQL*来自命令 window 的加载程序 Windows 7 机器上的西班牙语言环境。

控制文件:

LOAD DATA
CHARACTERSET UTF8
INFILE  'C:\tmp\xxxy.txt'
BADFILE 'C:\tmp\xxxy.bad'
TRUNCATE INTO TABLE  SAMPLE.TEST_CAR_VENCIMI_INTERMED
fields terminated by "¥"
TRAILING NULLCOLS
(
CODE             CHAR "upper(ltrim(rtrim(:CODE)))",
CIF              CHAR "upper(ltrim(rtrim(:CIF)))",
CODIGO_PRESTAMO  CHAR "upper(ltrim(rtrim(:CODIGO_PRESTAMO)))"
)

示例数据文件:

21AK0100¥P11111111F¥910002¥000000000106013.64¥666666666¥mail@domain.com¥address¥11111¥Name¥Surname 1¥Surname 2¥mail2@domain.com¥666666666

由于您使用的是 UTF8 字符和 UTF8 文件格式(我认为),对于运行 SQL*Loader 的会话,将您的 NLS_LANG 环境变量设置为 "SPANISH_SPAIN.UTF8" .