Loading default value when exists null or blanks SQL Loader [message #188289] |
Thu, 17 August 2006 17:36 |
superoscarin@hotmail.com
Messages: 101 Registered: July 2006 Location: Mexico
|
Senior Member |
|
|
Hi:
Are there any way with SQL Loader to load data by default in a specific field.
it's mean that if I have null or "", can i insert a defalut value for this field.
For example:
LOAD DATA
INFILE FILE1
into table A
APPEND
(
id integer external,
data1 boundfiller
data --and here insert a default value when exist a null or blank values??
)
Thanks to all for your answers
Alex
|
|
|
|
|
|
|
Re: Loading default value when exists null or blanks SQL Loader [message #188488 is a reply to message #188480] |
Fri, 18 August 2006 13:46 |
|
ebrian
Messages: 2794 Registered: April 2006
|
Senior Member |
|
|
load data
infile *
into table a
fields terminated by ','
TRAILING NULLCOLS
(
id integer external,
data1 boundfiller,
data "nvl2(:data,:data1||:data,:data1||'default value')"
)
BEGINDATA
1,Test data for 1,
2,Test data for 2,NOTNULL
SQL> select * from a;
ID DATA
---------- --------------------------------------
1 Test data for 1default value
2 Test data for 2NOTNULL
|
|
|
|