我正在尝试在过去几个小时内将.xml数据文件加载到oracle中但没有成功。
======这是我的.ctl文件====
LOAD DATA
INFILE output.xml "STR '</article>'"
BADFILE output.BAD
TRUNCATE
INTO TABLE FERNANDO.ARTICLES
TRAILING NULLCOLS
(
dummy filler terminated by "article>",
articlesTitle VARCHAR(500) enclosed by "<title>" and "</title>",
articlesAuthor CHAR(100) enclosed by "<author>" and "</author>",
articlesText CHAR(50000) enclosed by "<text>" and "</text>",
articlesClient CHAR(50) enclosed by "<client>" and "</client>",
articlesCharset CHAR(50) enclosed by "<charset>" and "</charset>",
articlesHeaders CHAR(5000) enclosed by "<headers>" and "</headers>",
articlesTransferEncoding CHAR(50) enclosed by "{Transfer-encoding=" and ", ",
articlesCacheControl CHAR(50) enclosed by "Cache-control=" and ", ",
articlesContentType CHAR(500) enclosed by "Content-type=" and ", ",
articlesPostedDate CHAR(50) enclosed by "Date=" and ", ",
articlesExpireDate CHAR(50) enclosed by "Expires=" and ", ",
articlesSetCookie CHAR(500) enclosed by "Set-cookie=" and ", ",
articlesDomain CHAR(50) enclosed by "Domain=" and ", ",
articlesServer CHAR(200) enclosed by "Server=" and ", ",
articlesPragma CHAR(200) enclosed by "Pragma=" and ", "
)
但是,我在每隔一行都有以下错误:
Record 10: Rejected - Error on table FERNANDO.ARTICLES.
ORA-01461: can bind a LONG value only for insert into a LONG column
文章表如下:
CREATE TABLE ARTICLES (
articlesTitle VARCHAR2(255) NOT NULL ,
articlesAuthor VARCHAR2(64) NULL ,
articlesText VARCHAR2(1024) NULL ,
articlesClient CHAR(18) NULL ,
articlesCharset CHAR(18) NULL ,
articlesHeaders CHAR(255) NULL ,
articlesTransferEncoding VARCHAR2(12) NULL ,
articlesCacheControl VARCHAR2(12) NULL ,
articlesContentType VARCHAR2(12) NULL ,
articlesPostedDate DATE NULL ,
articlesExpireDate DATE NULL ,
articlesSetCookie VARCHAR2(128) NULL ,
articlesDomain VARCHAR2(64) NULL ,
articlesServer VARCHAR2(24) NULL ,
articlesPragma VARCHAR2(128) NULL ,
urlFrontierURL VARCHAR2(128) NULL ,
CONSTRAINT XPK_ARTICLES PRIMARY KEY (articlesTitle))
TABLESPACE project_tablespace
STORAGE (INITIAL 8192 NEXT 8192 MINEXTENTS 1 MAXEXTENTS 150000 );
答案 0 :(得分:1)
为什么数据文件列的长度与表的长度不同?
因为您尝试插入长度超过4000个字符的char数据而发生该错误