Home » Infrastructure » Windows » Load data of multiple files from dynamic (windos 7, oracle xe 11g r2)
Load data of multiple files from dynamic [message #647275] Mon, 25 January 2016 04:11 Go to next message
mokarem
Messages: 109
Registered: November 2013
Location: Dhaka
Senior Member

If I keep Control file, data file and Batch file in same location, I can load multiple csv files in a single table using single control file as below:

for %%f in (*.csv) do sqlldr hr/hr@xe control=emp_data.ctl data=%%f


But I need the data file should be in different location.
I created separate folders like BATCH, CTL, DATA and tried to modify the script as below:

@echo off
set  dir_path=C:\Users\smokarem\Loader
@echo on


for %%f in (!dir_path!\data\*.csv) do sqlldr hr/hr@xe control=!dir_path!\ctl\emp_data.ctl data=!dir_path!\data\%%f.csv


This is not working. Please help me to resolve it.
Re: Load data of multiple files from dynamic [message #647278 is a reply to message #647275] Mon, 25 January 2016 04:28 Go to previous messageGo to next message
Michel Cadot
Messages: 65255
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What does "it is not working" mean?

Re: Load data of multiple files from dynamic [message #647279 is a reply to message #647278] Mon, 25 January 2016 04:54 Go to previous messageGo to next message
mokarem
Messages: 109
Registered: November 2013
Location: Dhaka
Senior Member

Quote:

What does "it is not working" mean?


Means, it cannot load data.

An small modification on previous code which cannot load data.

@echo off
set  dir_path=C:\Users\smokarem\Loader
@echo on


for %%f in (!dir_path!\data\*.csv) do sqlldr hr/hr@xe control=!dir_path!\ctl\emp_data.ctl data=!dir_path!\data\%%f

Re: Load data of multiple files from dynamic [message #647280 is a reply to message #647279] Mon, 25 January 2016 05:04 Go to previous messageGo to next message
Michel Cadot
Messages: 65255
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

What does mean "it cannot load data"?

Re: Load data of multiple files from dynamic [message #647291 is a reply to message #647279] Mon, 25 January 2016 07:57 Go to previous message
EdStevens
Messages: 863
Registered: September 2013
Senior Member
No one is looking over your shoulder. We cannot see your system.
Oracle emits error messages for a reason. Help us to help you by sharing them.
Previous Topic: SQL*Plus redirect STDIN on WIndows
Next Topic: No OLE DB
Goto Forum:
  


Current Time: Fri Dec 15 04:10:52 CST 2017

Total time taken to generate the page: 0.01718 seconds