Re: A(nother) SQL loader question

From: <Mike>
Date: Wed, 11 Apr 2001 00:58:44 -0700
Message-ID: <op28dtg1lrk9v7mta59t3r4kmcv8p3o9p2_at_4ax.com>


[Quoted] On Tue, 10 Apr 2001 12:09:53 -0400, Reg <RegBurgess_at_Lucent.com> wrote:

Reg,

I don't know of a way to do it with just SQL*Loader, but here's an approach that should work if the files all have different names.

Create a batch file that calls an archive utility to gather the files into one directory. Then concatenate the files and call SQL*Loader to import the combined file. Assuming the files all have the extension .TXT (for example), the commands with the version of PkZip I use would be

pkzip -r arcfile *.txt
pkunzip arcfile
copy *.txt bigfile.dat
sqlldr <your options here> data=bigfile.dat del bigfile.dat
del *.txt
del arcfile.zip

The "-r" switch for PkZip means recurse through subdirectories. Since the "-p" switch is not included, PkZip doesn't store the paths. Therefore the files all end up at the same "level" in the .ZIP file. PkUnzip then extracts them into the current directory where they are concatenated into bigfile.dat and loaded into Oracle. HTH

Mike S.

>I know the basics, I'm having trouble figuring out how to use wildcards
>for filenames.  (In windoze NT).
>
>I have a directory tree, below a certain level it contains ONLY
>datafiles that I want to load into the same table.  The number of files
>is unknown it is likely to vary from day to day, the number of directory
>
>levels is not yet known, but is probably 3 or 4, this may be fixed but
>has not yet been determined, e.g. there could be a directory level that
>has files and sub-directories I need to include the files and the files
>in all directories below.
>
>So, basically I want to walk the tree, collect all files and sqlload
>append them to the table.
>Hints, clues, suggestions are welcome - I've tried reading the manuals,
>I may have missed it so pointers are also appreciated.
>
>\R



  Received on Wed Apr 11 2001 - 09:58:44 CEST

Original text of this message