Sunday, February 21, 2010

SQL Loader- Field in data file exceeds maximum length

Errors :: Field in data file exceeds maximum length

If Field is having enough width size and not accommodating records into that from text file.

Reason:: By default char field take only upto 255 character, if records size is more then you have to modify your controlfile and specify the char field width size

Solutions:: Modify your control file and add CHAR(size) in front of column, below are a dummy control file for your reference.

$ cat apprvlcomment.ctl
load datainfile *into table application_approval_comments
fields terminated by ''
optionally enclosed by X'9' trailing nullcols
(APPL_NUM,
GRPS,
FIRST_APPRVR_USRID,
FRST_APPRVR_COMMENTS char(2000),
FRST_RVWR_USRID,
FRST_RVWR_COMMNTS char(2000),
SCND_RVWR_USRID,
SCND_RVWR_COMMNTS char(2000),
THIRD_RVWR_USRID,
THIRD_RVWR_COMMNTS char(2000),
ADDTNL_APPRVR_COMMNTS char(2000))


Wahid Ali Khan

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.