0

I am using sqlloader to import pdf files to the database as blobs. The control file is as follows

LOAD DATA
INFILE *
INTO TABLE pdf_files
APPEND
FIELDS TERMINATED BY ','
(
    pdfid   char(20),
    pdf_year     char(4),
    pdf_province    char(2),
    pdf_load_location       char(100),
    pdf_file        lobfile (pdf_load_location) TERMINATED BY EOF
)
BEGINDATA   
test-form-en,2012,QC,/home/oracle/TestForms/forms/en/test-form.pdf, 

Then I got error messages in the log:

Record 1: Rejected - Error on table PDF_FILES.
ORA-00001: unique constraint (SCOTT.SYS_C0011439) violated

I checked the constraint SCOTT.SYS_C0011439 as follows

select * from user_constraints where constraint_name='SYS_C0011439';

Then I found constraint SYS_C0011439 is actually on an irrelevant table 'T2032'. This table has nothing to do with table pdf_files which I want to import data. And the constraint is the not null check constraint.

Anybody knows why sqlloader gets some irrelevant table/constraint checked when I tried to load data to just one specific table? Thanks

Raistlin
  • 407
  • 1
  • 8
  • 19
  • This might be because of a foreign key Can you please provide the complete output of : select * from user_constraints where constraint_name='SYS_C0011439'; – A Nice Guy Jul 02 '13 at 18:01

1 Answers1

0

Got the same problem again and this time found the reason. There is already an data entry (blob with the specified pdf location) in the database for the rejected record.

Raistlin
  • 407
  • 1
  • 8
  • 19