Skip to Main Content

SQL & PL/SQL

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!

Load multiple lines data into CLOB clob

user575115Jul 5 2019 — edited Jul 12 2019

Hi, We got file exported data in form of csv including clob column from source oracle DB and need to load the data into target oracle table using sql loader.

Database

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

PL/SQL Release 12.1.0.2.0 - Production

target table

create table P_STG

(

t_rn      NUMBER,

t_date VARCHAR2(8),

record_code     VARCHAR2(2),

record_key      NUMBER,

mod_cdate       VARCHAR2(8),

mod_operator    VARCHAR2(8),

operator        VARCHAR2(30),

status          VARCHAR2(1),

error_message   VARCHAR2(1000),

text_string     CLOB,

create_date     DATE,

code VARCHAR2(10)

)

i tired like below

Load Data 


Infile 'C:\Users\vkakanur\Desktop\loader\loader_export_pt.csv' "str x'0D'"

BADFILE 'p1.bad'

DISCARDFILE 'p1.dsc'

Truncate

--continueif last <> '"'

into Table t_stg

FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'

Trailing Nullcols

(

t_RN,

t_DATE,

RECORD_CODE,

RECORD_KEY,

MOD_CDATE,

MOD_OPERATOR,

OPERATOR,

STATUS,

ERROR_MESSAGE,

fname filler char,

TEXT_STRING LOBFILE(fname) TERMINATED BY EOF,

CREATE_DATE,

CODE

)

Input data in file

*** Moderator action (Timo): removed the data from the post as it is looking to contain private data which should not be disclosed in this public space!

User, provide data which is obfuscated in a way that it doesn't look like private data, please!

***

Comments
Post Details
Added on Jul 5 2019
6 comments
3,767 views