Home » RDBMS Server » Server Utilities » Loader question
Loader question [message #142703] Mon, 17 October 2005 05:58 Go to next message
saipavan
Messages: 20
Registered: July 2005
Junior Member
i am having a .in file with the data in the following manner

77|XYZ|77
86|MAST|86
87|GAT|87
99|KLN|99
36|ABC|36

and the control file in the following way

load data
infile 'C:\gfms.in'
into table gfm
fields terminated by "|"
( id,name,mgrid)

like wise i have so many .in files and .ctl files. Everytime it has become a tedious task for me to just load one by one from command prompt. Is there anyway to load the file in bulk into the corresponding tables of the database. Can just provide me a solution to overcome this horrifying one by one loading..

Thanks in advance
Sai
Re: Loader question [message #142722 is a reply to message #142703] Mon, 17 October 2005 07:23 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
If it always been loaded into same table, you can have multiple input files mentioned in the same control file.
or
You can easily do a 'batch load' kind of thingy with a little scripting.
Idea is to create the control file dynamically during the runtime.
Something like this.
http://www.orafaq.com/forum/t/26733/0/
You can make it any fancy you want.

Please look into above link and try it.
If it is not too helping post again with your OS and how exactly you want ( a zillion possibilities here, to automate your work).
1. call the script with parameters (tablename,inputfilename).
2. If the input data is simple(no converstion etc) you even generate controlfile on the fly from table ddl.
3. execute one script which reads a file that has all the infilee,table-name,controlfile name etc).
Previous Topic: EXP from DOS - appending date to .dmp file name
Next Topic: does oracle 8 support export to multiple files ?
Goto Forum:
  


Current Time: Thu Dec 26 06:25:02 CST 2024