0

在过去的几个小时里,我试图将一个 .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 ); 
4

1 回答 1

1

为什么数据文件列的长度与表不同?

可能会发生该错误,因为您尝试插入长度超过 4000 个字符的字符数据

于 2010-12-06T00:30:02.913 回答