SqlLoader Insert Data - Automatic [message #127473] |
Mon, 11 July 2005 16:31 |
sam20
Messages: 3 Registered: July 2005
|
Junior Member |
|
|
Hi all,
I have a data in a text file which is updated once in a while. I want to load data from that text file to oracle database when either there is new data in a text file text file or every hour (any criteria will do). Can i write a cntl file for that? If yes can i write a scheduled Cntl file to do that? Because i want to run that Cntl file automatically.
Please help me with this.
Sam
|
|
|
|
Re: SqlLoader Insert Data - Automatic [message #127594 is a reply to message #127473] |
Tue, 12 July 2005 07:56 |
smartin
Messages: 1803 Registered: March 2005 Location: Jacksonville, Florida
|
Senior Member |
|
|
Some of this depends on the specifics, but that sounds like a nice approach. Other options that came to my mind were:
1) having an external table and using a merge statement on a schedule
2) scheduling a sqlldr session to truncate into target table every hour
But, for large quantities of data, the MV approach would only need to worry with data that had changed, which would be better than option 2 reloading all of it; and it wouldn't need any extra coding as it would use the built-in mv refresh feature, which would be better to create and maintain than option 1.
|
|
|
|
|
Re: SqlLoader Insert Data - Automatic [message #127641 is a reply to message #127473] |
Tue, 12 July 2005 11:33 |
sam20
Messages: 3 Registered: July 2005
|
Junior Member |
|
|
I have a table in oracle. How can i make it external table and how can i uses MV's to refresh table so that it inserts data from txt file every hour. This is something new to me that's why i am not very clear how to do it.
|
|
|
Re: SqlLoader Insert Data - Automatic [message #127645 is a reply to message #127473] |
Tue, 12 July 2005 11:39 |
smartin
Messages: 1803 Registered: March 2005 Location: Jacksonville, Florida
|
Senior Member |
|
|
The table in oracle would not be the external table. An external table is one where the data does not reside in the database, but instead resides in a flat file on the filesystem. So your external table would be your text file.
Please read a bit in the link supplied above where it talks about managing external tables. It tells you how to do it and shows examples.
|
|
|