Home » RDBMS Server » Server Utilities » Dynamic control file generation in WINDOWS Environment (Oracle 9i, Windows)
Dynamic control file generation in WINDOWS Environment [message #467330] Fri, 23 July 2010 07:29 Go to next message
varunendra
Messages: 4
Registered: July 2010
Location: India
Junior Member
Hello Friends,

I am trying to generate dynamic control file, as the files I want to upload are coming from different source and their name is constantly changing but following a fix pattern and naming convention.

I am able to generate dynamic control file through SQL. But while calling from BATCH file, i am unable to sent the file name as parameter.

All the examples i have searched are for UNIX, pls help me how to do it with BATCH File in WINDOWS.
Re: Dynamic control file generation in WINDOWS Environment [message #467349 is a reply to message #467330] Fri, 23 July 2010 09:28 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Here is an example.
http://www.orafaq.com/forum/mv/msg/26733/73236/42800/#msg_73236

If you are passing just inputDatfile, you can directly pass it to sqlldr command line argument.
Re: Dynamic control file generation in WINDOWS Environment [message #467350 is a reply to message #467330] Fri, 23 July 2010 09:30 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.cygwin.com/

Install CYGWIN on your Windoze box & then follow existing examples to create desired control file.
Alternatively create control file using PERL to be OS independent
Re: Dynamic control file generation in WINDOWS Environment [message #474460 is a reply to message #467350] Mon, 06 September 2010 10:27 Go to previous messageGo to next message
varunendra
Messages: 4
Registered: July 2010
Location: India
Junior Member
Hi all, I am able to find the solution of my problem.
What I am doing now is to generate control file dynamically by using ECHO option of DOS.
its shown as below -

echo OPTIONS ( ERRORS=10000000) > abc.ctl
echo load data >> abc.ctl
remark - the below lines read all txt file in directory and passes there name to abc.ctl control file.
for /f %%a IN ('dir /b D:\a\*.txt') do echo INFILE  'D:\a\%%a'  >>abc.ctl
echo 
echo append INTO TABLE tablename>>abc.ctl
echo fields terminated by '+' >>abc.ctl
echo ( >>abc.ctl
feild1,field2,field3) >>flat.ctl
sqlldr userid = USERNAME/PWD@DBNAME
control=abc.ctl




CM: replaced colour tags with code tags

[Updated on: Mon, 06 September 2010 10:34] by Moderator

Report message to a moderator

Re: Dynamic control file generation in WINDOWS Environment [message #474463 is a reply to message #474460] Mon, 06 September 2010 10:34 Go to previous message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Thanks for letting us know.
Previous Topic: Need to know how long export takes
Next Topic: Errors While Import.
Goto Forum:
  


Current Time: Fri Apr 19 17:04:55 CDT 2024