OK, I've cleaned it up, compiled it, using olu's help.

olus, your help was great, but I need to call SQLplus on the sql files and SQL*Loader with the ctl files, but it was the guidance I needed (as well as the kick in the rear ;)

Thanks again for the help folks.

my $workDir = './whatever'; my $oraLogin = 'user/password\@database'; my @filesToLoad = ( { "FileName" => 'datfile.dat',"FileLoc" => 'filedir',"OKFile" => "O +K.htm"}); chdir($workDir); foreach my $fileToLoad (@filesToLoad) { my $fileToLoadPath = "$workDir/$fileToLoad{'FileLoc'}"; my $dataFile = "$fileToLoadPath/$fileToLoa{'FileName'}"; my $okFile = "$fileToLoadPath/$fileToLoad{'OKFile'}"; if ($fileToLoad{'OKFile'}!="NO" && -e $dataFile ) { #remove OK file if (-e $okFile) {rm("$okFile");} #load available files opendir CTLDIR, $fileToLoadPath; my @allFiles = readdir(CTLDIR); closedir CTLDIR; # build array of files my @ctlFiles = grep {/\.run_ctl/i} @allFiles; my @sqlFiles = grep {/\.run_sql/i} @allFiles; #execute the files SQLloader($fileToLoadPath, \@ctlFiles); SQLplus ($fileToLoadPath, \@sqlFiles); } } sub SQLloader { my $path = shift; my $fileList = shift; foreach my $file (@{ $fileList }) { system("sqlldr $oraLogin control=$path/$file rows=10000 error +s=99999 $path/sqlldr.log"); } } sub SQLplus { my $path = shift; my $fileList = shift; foreach my $file (@{ $fileList }) { system("sqlplus $oraLogin \@$path/$file"); } }

In reply to Re: Anyone want to compress this a little more? by Anonymous Monk
in thread Anyone want to compress this a little more? by naveed010

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.