Home » Infrastructure » Unix » How to load data from a .csv file, having different name, on daily basis using sqlldr
How to load data from a .csv file, having different name, on daily basis using sqlldr [message #229433] Sat, 07 April 2007 14:56 Go to next message
shwetabhandari02
Messages: 5
Registered: April 2007
Junior Member
Hi All,
I get a .csv file on daily basis in a directory on UNIX box. Its name changes daily.
I can load the data from the .csv file into a temp table in oracle when I hard code the name of the csv file. However, as per the requirement I need to load the data from any .csv file which comes in that particular directory.
Using *.csv in ctl file does'nt work.
How else can I do this?
Your help would be highly appreciated.
Thanks and Regards,
Shweta Bhandari
Re: How to load data from a .csv file, having different name, on daily basis using sqlldr [message #229434 is a reply to message #229433] Sat, 07 April 2007 16:25 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Quote:
Reported By: shwetabhandari02 On: Sat, 07 April 2007 17:09 In: Platforms Unix How to load data from a .csv file, having different name, on daily basis using sqlldr
Reason Hi, I am working on a project where i need to load data from a CSV file. It would be FTP'd on a UNIX server and would have a different name on daily. Kindly let me know how to do it. Thanks and Regards, Shweta Bhandari

Do not report postings to get attention. It will actually work negative.

Always Search before posting.
>> I hard code the name of the csv file. However, as per the requirement
You do not need to.
use
INFILE *

in control file and specify datafile as input parameter

sqlldr user/password control=mycontrolfile data=mydatafile.dat
Re: How to load data from a .csv file, having different name, on daily basis using sqlldr [message #229475 is a reply to message #229434] Sun, 08 April 2007 14:26 Go to previous messageGo to next message
shwetabhandari02
Messages: 5
Registered: April 2007
Junior Member
Thank you Mahesh,for the response and advice not to report postings. As I am a new member I did not realize this.
The option of using "INFILE *"would not work for me as need the data only from a CSV file that would be present in a particular directory. Now there would be other files as well apart from CSV file.
However, I have resolved the issue. What I am doing now is saving a copy of the CSV file with a constant name daily and then moving the original file to another directory.
Thanks and Regards,
Shweta
Re: How to load data from a .csv file, having different name, on daily basis using sqlldr [message #229630 is a reply to message #229475] Mon, 09 April 2007 07:45 Go to previous message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>> Now there would be other files as well apart from CSV file
Not a big deal.
You can easily script the process to search for pattern of files in the directory (*.txt,*.csv, myfile*.txt, whatever) and load all files. Depends on what OS you are using.
Previous Topic: How to get a chunk of a file?
Next Topic: ORA-12547: TNS:lost contact
Goto Forum:
  


Current Time: Mon Dec 05 19:24:12 CST 2016

Total time taken to generate the page: 0.14965 seconds