Home » RDBMS Server » Server Utilities » Control file fields interchange
Control file fields interchange [message #182299] Fri, 14 July 2006 04:33 Go to next message
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 #182304 is a reply to message #182299] Fri, 14 July 2006 04:48 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
reported message

Reported By: Ramnath On: Fri, 14 July 2006 11:40
In: RDBMS Server » Server Utilities » Control file fields interchange
Reason Please answer this query.
Don't report messages to get attention. Wait in line like everyone else. Only a few people see these reports and they are meant to get the mod's attention for offensive, duplicate or inappropriate messages.

Besides, you waited what? 7 minutes before reporting. Shame on you!

MHE
Re: Control file fields interchange [message #182314 is a reply to message #182304] Fri, 14 July 2006 05:24 Go to previous messageGo to next message
Ramnath
Messages: 7
Registered: July 2006
Junior Member
sorry i didn't know the purpose of that.
I Apologies for that.
Re: Control file fields interchange [message #182375 is a reply to message #182314] Fri, 14 July 2006 08:33 Go to previous message
Mahesh Rajendran
Messages: 10707
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.
Previous Topic: how to connect sqlldr
Next Topic: how to call control file
Goto Forum:
  


Current Time: Fri Jul 05 18:51:05 CDT 2024