Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bug in sqlldr using trim in ctl ?

user1058993Sep 18 2013 — edited Sep 19 2013

Hi Guys,

When I am trying to upload data using ctl file having trim in one of the fields, the length of that column in database is not being considered.

The control file is

OPTIONS (SKIP=1, ERRORS=99999999, DIRECT=TRUE )

LOAD DATA

CHARACTERSET WE8ISO8859P15

APPEND

INTO TABLE s_test_trim

WHEN RECORD_TYPE='D'

FIELDS TERMINATED BY '|'

TRAILING NULLCOLS

( static_1 CONSTANT "13-Sep-2013" ,

static_2 CONSTANT "AMERICAS" ,

field_1 CHAR "TRIM(:field_1)" );

The ddl for table is

CREATE TABLE s_test_trim

( static_1 DATE NOT NULL ,

static_2 VARCHAR2(10) NOT NULL ,

field_1 VARCHAR2(10) )

COMPRESS ;

Now, when I am trying to load data of field length > 10 for field_1, it is allowing me to do so.

I mean the field length for field_1 is 10, but when I am trying to insert data having value greater than 10 chars, it is inserting the data into the column.

When I am trying to do the same, using insert statement, it is throwing expected error message.

I am using 11g

Please guide me.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2013
Added on Sep 18 2013
7 comments
3,122 views