Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sqlldr error

Status
Not open for further replies.

syncdba

IS-IT--Management
Nov 28, 2005
206
US
Hi,
I'm trying to run this sqlldr

LOAD DATA
INFILE 'C:\ESTA\test1.csv'
REPLACE
INTO TABLE stage_internal_learners
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
INTERNAL_LEARNER_IDENTIFIER "stage_internal_learner_s.NEXTVAL",
EMPLOYEE_NUMBER "LTRIM(RTRIM:)EMPLOYEE_NUMBER))" ,
STATUS "LTRIM(RTRIM:)STATUS))" ,
MANAGER_USERNAME "LTRIM(RTRIM:)MANAGER_USERNAME))" ,
EMPLOYEE_TYPE "LTRIM(RTRIM:)EMPLOYEE_TYPE))" ,
JOB_TYPE "LTRIM(RTRIM:)JOB_TYPE))" ,
LEGAL_ENTITY_CODE "LTRIM(RTRIM:)LEGAL_ENTITY_CODE))" ,
TITLE "LTRIM(RTRIM:)TITLE))",
FIRST_NAME "LTRIM(RTRIM:)FIRST_NAME))",
LAST_NAME "LTRIM(RTRIM:)LAST_NAME))",
MIDDLE_NAME "LTRIM(RTRIM:)MIDDLE_NAME))" ,
WORK_PHONE "LTRIM(RTRIM:)WORK_PHONE))" ,
FAX "LTRIM(RTRIM:)FAX))" ,
EMAIL "LTRIM(RTRIM:)EMAIL))" ,
USERNAME "LTRIM(RTRIM:)USERNAME))" ,
ADDRESS1 "LTRIM(RTRIM:)ADDRESS1))" ,
ADDRESS2 "LTRIM(RTRIM:)ADDRESS2))" ,
ADDRESS3 "LTRIM(RTRIM:)ADDRESS3))" ,
CITY "LTRIM(RTRIM:)CITY))" ,
STATE "LTRIM(RTRIM:)STATE))" ,
ZIP "LTRIM(RTRIM:)ZIP))" ,
COUNTRY "LTRIM(RTRIM:)COUNTRY))" ,
SUFFIX "LTRIM(RTRIM:)SUFFIX ))" ,
JOB_TITLE "LTRIM(RTRIM:)JOB_TITLE))" ,
EMPLOYEE_PREFERRED_NAME "LTRIM(RTRIM:)EMPLOYEE_PREFERRED_NAME))" ,
SET_OF_BOOKS_ID "LTRIM(RTRIM:)SET_OF_BOOKS_ID))" ,
COST_CENTER "LTRIM(RTRIM:)COST_CENTER))" ,
SOURCE_SYSTEM "LTRIM(RTRIM:)SOURCE_SYSTEM))",
DATA_SOURCE "LTRIM(RTRIM:)DATA_SOURCE))" ,
CREATION_DATE SYSDATE )

but getting error

Record 1: Rejected - Error on table STAGE_INTERNAL_LEARNERS.
ORA-01400: cannot insert NULL into ("XXHD_TP2"."STAGE_INTERNAL_LEARNERS"."FIRST_NAME")

Record 2: Rejected - Error on table STAGE_INTERNAL_LEARNERS.
ORA-01400: cannot insert NULL into ("XXHD_TP2"."STAGE_INTERNAL_LEARNERS"."FIRST_NAME")

Record 3: Rejected - Error on table STAGE_INTERNAL_LEARNERS.
ORA-01400: cannot insert NULL into ("XXHD_TP2"."STAGE_INTERNAL_LEARNERS"."FIRST_NAME")

I have checked all the data in first_name, there is no "NULL" data.
 
syncdba,

I note that you are doing combinations of rtrim and ltrim. Since you aren't deleting anything other than white spaces, why don't you just use TRIM?

Can you check your data that when you TRIM the FIRST_NAME field, it doesn't produce any nulls?

Can you post your table structure and sample data, then I can try to reproduce the problem here, and help some more.

As a further suggestion, you might temporarily drop the not null constraint, get the data into the table, and then query for nulls in the FIRST_NAME column. This would show you the dud data, which you could then correct. Then truncate the table, reinstate the constraint, and load 'er up!

Regards

Tharg

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top