how to use sqlldr direct path to load chr(0) [message #218735] |
Fri, 09 February 2007 12:36 |
Averell
Messages: 17 Registered: November 2006
|
Junior Member |
|
|
Hi all,
In db A, I have a table T1 created as follow.
create table T1(f1 number, f2 char(1),...);
In db B, I have:
create table T2(f1 number, f2 char(1));
I want to fill T2 with data from T1. The field f2 is a flag, which can be in one of two values:
SQL> select distinct ascii(F2) from T1;
ASCII(F2)
---------
1
0
My un-wanted result is as follow:
SQL> select distinct ascii(F2) from T2;
ASCII(F2)
---------
1
48
To unload data, I use: select f1 || ',' || f2 from T1;. My spooled file is somehow as follow:
1234,<a byte = 32>
5678,<a byte = 1> .
Then I tried to load data into T2 using sqlldr, direct path, with control file is as follow
LOAD DATA
PRESERVE BLANKS
INTO TABLE T2
REPLACE
FIELDS TERMINATED BY ','
TRAILING NULLCOLS
( F1,
F2 INTEGER EXTERNAL DEFAULTIF F2=BLANKS,
)
Could you please help me solve this problem? (I have millions of records to move, so, I need direct path mode).
Thank you very much!
[Updated on: Sat, 10 February 2007 05:23] Report message to a moderator
|
|
|
|