Home » RDBMS Server » Server Utilities » Sqlldr NVL Direct Load
Sqlldr NVL Direct Load [message #111632] Fri, 18 March 2005 05:57 Go to next message
shufflej
Messages: 1
Registered: March 2005
Junior Member
Hi,

When using sqllldr for a conventional load and the control file

load data
infile '/usr/test.txt'
into table test
fields terminated by "|"
TRAILING NULLCOLS
(
COMPNO "nvl(:COMPNO,' ')"
,CUSACCNO "nvl(:CUSACCNO,' ')"
)

works fine, the Null values in the import file are translated to ' ' and then fullfill the not null definition on the table. However when I try to use the above on a direct data load "direct=true" the data is rejected:
ORA-01400: cannot insert NULL into (CUSACCNO).

I guess the question is can I use NVL in direct mode, if not is there another way around this in Direct=True.

Thanks
Re: Sqlldr NVL Direct Load [message #111637 is a reply to message #111632] Fri, 18 March 2005 06:15 Go to previous message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Consider using DEFAULTIF instead of nvl(). For details, see the Utilities Users Guide:

"If a DEFAULTIF clause is not specified and the field is NULL, then a null value is inserted into the database."

Best regards.

Frank

Previous Topic: export from a non-dba-user
Next Topic: Load data of choice
Goto Forum:
  


Current Time: Wed Jul 03 09:56:05 CDT 2024