Control file fields interchange [message #182299] |
Fri, 14 July 2006 04:33 |
Ramnath
Messages: 7 Registered: July 2006
|
Junior Member |
|
|
My input file has fields in different order and table has the same sets of fileds in different order.
Example:
INFILE:
23|aaa|india
44|bbb|us
Table :
Country No Name
india 23 aaa
us 44 bbb
Will the follwoing Control file works?:
FIELDS TERMINATED BY '|'
(
No Number,
Name char,
country char
}
[Updated on: Fri, 14 July 2006 04:40] Report message to a moderator
|
|
|
|
|
Re: Control file fields interchange [message #182375 is a reply to message #182314] |
Fri, 14 July 2006 08:33 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
Simplest method is to fix the input datafile before loading
oracle@mutation#cat country.data
23|aaa|india
44|bbb|us
oracle@mutation#awk -F"|" '{print $3"|"$1"|"$2}' country.data > another_country.data
oracle@mutation#cat another_country.data
india|23|aaa
us|44|bbb
or
look into FILLER options.
Or
load as-is into a staging table and rearrange later using sql means.
|
|
|