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!

I am trying to upload data from a .CSV file using SQL loader into a custom table.

User_P97H5Apr 8 2021

While loading the data to the custom table i am getting an error can someone please help in resolving this.
Record 1579: Rejected - Error on table Custom_table, column COLUMN1_CLOB.
second enclosure string not present
Record 1580: Rejected - Error on table Custom_table, column COLUMN2_CLOB.
no terminator found after TERMINATED and ENCLOSED field
Here COLUMN1_CLOB and COLUMN2_CLOB is of CLOB type.
Example of .CTL file and .CSV file.
CTL file:
OPTIONS (ERRORS = 1000, SKIP=1)
LOAD DATA INFILE '$FILE' --- Custom Path
CONTINUEIF LAST != '"'
into table Custom_table
REPLACE
fields TERMINATED BY "," optionally enclosed by '"'
TRAILING NULLCOLS
(
Column_test "TRIM(:Column_test)"
,COLUMN1_CLOB FILLER
,Column_test1 "TRIM(:Column_test1)"
,COLUMN2_CLOB FILLER CHAR(12000) optionally ENCLOSED BY '"'
,Column_test3 "TRIM(:Column_test3)"
,Column_test4 CONSTANT "I"
)
Note: I am getting error as the data in the COLUMN2_CLOB is having a null character into it. please help me in handling this.
Data example of CSV file.
"ABC","datavalues","data values 2","
","","brenm",,""
"xyz","datavalues234","data values 56","
","","abcdef",,""

Comments
Post Details
Added on Apr 8 2021
1 comment
470 views