RE: help with batch operation

  • From: Eugene Pipko <eugene.pipko@xxxxxxxxxxxx>
  • To: 'Yechiel Adar' <adar666@xxxxxxxxxxxx>
  • Date: Wed, 9 Sep 2009 12:21:40 -0700

Thanks for your reply, I, however went with "alter table...." option. Easier 
and cleaner in my opinion.

Regards,

Eugene Pipko
Seattle Pacific Industries
office: 253.872.5243
cell: 206.304.7726
P  Please consider the environment before printing this e-mail.

From: Yechiel Adar [mailto:adar666@xxxxxxxxxxxx]
Sent: Tuesday, September 08, 2009 10:07 PM
Cc: Eugene Pipko; 'Oracle L'
Subject: Re: help with batch operation

In the first option I forgot to write the sqlplus command between the copy and 
the move.


Adar Yechiel

Rechovot, Israel


Yechiel Adar wrote:
I read the replies and I assume that all the files are in the same structure as 
you are reading them using the same external table.
You have several options:
1) If you can process the data from all the files in the same time AND have 
disk space
    you can use:
    copy a.txt+b.txt+c.txt target.txt
    move *.txt archive\*.old /Y   -->move the files and rename them to old, 
overwrite existing files in archive.
    this will give you one big file, target.txt, that is concatenation of all 
the files and you can process that.
2) Use the for command.
    for %i in (*.txt) do call process_file %1
    and create file call_process.cmd that do:
    copy %1 target.txt  --> I prefer copy as the original file remains a is in 
case of problems, you can use rename.
    sqlplus whatever
    move %1 archive\%1 /Y --> move the file to archive directory and overwrite 
old file with that name
    exit


Adar Yechiel

Rechovot, Israel


Eugene Pipko wrote:
Hi all,
Running Oracle 9.2 on Windows.
I know this is Oracle forum, but it's somewhat related. This question is for 
those of you who run Oracle on Windows.
I have several ".txt" files in a directory (all different names) and looking 
for the possibility to do the following using .BAT file:

Take first file

rename it

run procedure (pass it in)

move it into archive dir

delete it from original dir

GOTO 1

Reason I have to do all this is because in step 3 I am using external table to 
read the ".txt" file and it has to have a unique file name.

Regards,

Eugene Pipko
Seattle Pacific Industries
office: 253.872.5243
cell: 206.304.7726
P  Please consider the environment before printing this e-mail.

Other related posts: