Operating System - HP-UX
1748044 Members
5009 Online
108757 Solutions
New Discussion юеВ

Re: Retrieving the values from a Table ????

 
harry d brown jr
Honored Contributor

Re: Retrieving the values from a Table ????

Your answer lies in rewriting your script in perl:

http://www.orafaq.org/faqperl.htm

v_filedate=`echo " select bat_in_dir,bat_out_dir from product; " |
$ORACLE_HOME/bin/sqlplus -s USERNAME/PASSWORD|tail -2 | head -1`;
echo $v_filedate;

#!/pathtoperl/perl
use strict;
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:orcl',
'USERNAMEHERE',
'PASSWORDHERE',
{ RaiseError => 1, AutoCommit => 0 }
) || die "Database connection not made: $DBI::errstr";
my $sql = qq{ select bat_in_dir,bat_out_dir from product };
my $sth = $dbh->prepare($sql);
$sth->execute();

my($indir, $outdir); # Declare columns
$sth->bind_columns(\$indir, \$outdir);

print "List:\n\n"; # Fetch rows from DB
while( $sth->fetch() ) {
print "$indir, $outdir \n";
}
$sth->finish(); # Close cursor
$dbh->disconnect;




live free or die
harry
Live Free or Die
Jonas Linden
New Member

Re: Retrieving the values from a Table ????

Hi

Try this

echo "
set heading off
set feedback off
set pagesize 0
select bat_in_dir from product
union all
select bat_out_dir from product;"|sqlplus -s USERNAME/PASSWORD|xargs rm -rf

Regards

Jonas
Rajkumar_3
Regular Advisor

Re: Retrieving the values from a Table ????

Hai all,

We cant remove the files directly...

I have attached one shell script which will read the parameters from the property file ...That script i recieved in the FAQ prepared by Robin...

so i have to follow in that way...Is it possible...

Regards
Raj
Oracle DBA