Ankur_kuls has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have a perl script which uses sqlplus for data processing. below is a part of my code...
##### Generating log file--- my $logfile = "${basePath}/VoucherStateChange.$filedate.log"; open (STDOUT, ">>", "$logfile") or die "Can't open logfile $logfile fo +r writing: $!\n"; open (STDERR, ">>", "$logfile") or die "Can't open logfile $logfile fo +r writing: $!\n"; print "$logfile\n"; my $SQLPLUS='/opt/oracle/product/11g/db_1/bin/sqlplus -S system/coolma +n7@vsdb'; `$SQLPLUS \@${basePath}/VoucherQuery1.sql $startdate> ${basePath}/Quer +yResult1.txt`;
Now output of my query which is written in VoucherQuery1.sql is being redirect to QueryResult1.txt. Now If I want that in case of any error, error message comes to the log file (oucherStateChange.$filedate.log) taken care by perl script instead of this QueryResult1.txt file. is it possible? thanks a lot...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to handel sqlplus error in perl script.
by graff (Chancellor) on Dec 23, 2014 at 08:14 UTC | |
|
Re: How to handel sqlplus error in perl script.
by Anonymous Monk on Dec 22, 2014 at 21:10 UTC | |
by Ankur_kuls (Sexton) on Dec 24, 2014 at 06:19 UTC | |
by Anonymous Monk on Dec 24, 2014 at 06:43 UTC | |
by Ankur_kuls (Sexton) on Dec 24, 2014 at 07:41 UTC | |
by poj (Abbot) on Dec 26, 2014 at 11:46 UTC |