Skip to Main Content

Analytics 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!

Manage datatypes while loading from File to SQL

Amigo3044Dec 15 2016 — edited Nov 8 2017

ODI Studio 12c

I am a beginner in ODI.

I am trying to load data from a file to an Oracle database (12c). Problem is that one of the fields in the flat file is more than 4000 characters and the mapping fails with:

ORA-01461: can bind a LONG value only for insert into a LONG column

I see that the intermediate table C$_0DEFAULT is getting created with the offending field as VARCHAR2(4000). My final target table REVIEWS is, of course, created with a CLOB column for the same field.

The offending field in the flat file is "comments"

Flat file REVIEWS.csv

1listing_idNumeric5012null
2idNumeric5012null
3review_dateString100100null
4reviewer_idNumeric5012null
5reviewer_nameString40004000null
6commentsString40004000

null

Oracle REVIEWS table (final target)

1LISTING_IDNUMBERnullnullfalse
2IDNUMBERnullnullfalse
3REVIEW_DATEVARCHAR2100nullfalse
4REVIEWER_IDNUMBERnullnullfalse
5REVIEWER_NAMEVARCHAR24000nullfalse
6COMMENTSCLOBnullnullfalse

C$_0DEFAULT table after failed Run of the mapping

SQL> desc c$_0default

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

LISTING_ID                                         NUMBER(12)

ID                                                 NUMBER(12)

REVIEW_DATE                                        VARCHAR2(100)

REVIEWER_ID                                        NUMBER(12)

REVIEWER_NAME                                      VARCHAR2(4000)

COMMENTS                                           VARCHAR2(4000)

My question is how can I ensure that the C$_0DEFAULT.COMMENTS column gets created with a CLOB column? Or, how can I load data directly in the REVIEWS table?

Thanks for any suggestions.

This post has been answered by ashud1 on Dec 15 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 12 2017
Added on Dec 15 2016
2 comments
845 views