SQL*Load with concatenation [message #139562] |
Wed, 28 September 2005 12:18 |
vqd2697
Messages: 36 Registered: October 2004
|
Member |
|
|
I have a data file like this:
1250
-2406
and would like to use sqlloader to load in value:
$1250
-$2406
What is the syntax to put in control file for this column.
Thanks,
Vu
|
|
|
Re: SQL*Load with concatenation [message #139986 is a reply to message #139562] |
Fri, 30 September 2005 07:27 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
see this control file
LOAD DATA
INFILE 'ulcase7.dat'
DISCARDFILE 'ulcase7.dis'
APPEND
INTO TABLE emp
WHEN (57)='.'
TRAILING NULLCOLS
(hiredate SYSDATE,
deptno POSITION(1:2) INTEGER EXTERNAL(3)
NULLIF deptno=BLANKS,
job POSITION(7:14) CHAR TERMINATED BY WHITESPACE
NULLIF job=BLANKS "UPPER(:job)",
mgr POSITION(28:31) INTEGER EXTERNAL TERMINATED BY WHITESPACE
NULLIF mgr=BLANKS,
ename POSITION (34:41) CHAR TERMINATED BY WHITESPACE
"UPPER(:ename)",
empno INTEGER EXTERNAL TERMINATED BY WHITESPACE,
sal POSITION(51) CHAR TERMINATED BY WHITESPACE
"TO_NUMBER(:sal,'$99,999.99')",
comm INTEGER EXTERNAL ENCLOSED BY '(' AND '%'
":comm * 100"
)
notice the to_number function, i think it should solve your problem.
regards,
tarun
[Updated on: Fri, 30 September 2005 07:29] Report message to a moderator
|
|
|