Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Running perl DBI in PLSQL on UNIX
It does not appear to be related to DBI at least for now. I removed all
the existing perl code except the open(). Running this on Solaris 8,
DB:9203.
$> more /tmp/tmp.pl
#!/usr/bin/perl
use strict;
use warnings;
$| = 1;
print "Before STDOUT...\n\n";
open (STDOUT,"|tee /tmp/out.log");
print "Before STDERR...\n\n";
open (STDERR,">&STDOUT");
print "Before close STDERR...\n\n";
close (STDERR);
print "End of Prog...\n\n";
I then execute my procedure,
SQL> variable a number; SQL> set serveroutput on SQL> exec dbms_java.set_output(100000); SQL> exec :a:=execcmd('/tmp/tmp.pl');
PL/SQL procedure successfully completed.
It appears that the program just terminated at 'Before STDOUT'. The file /tmp/out.log was not created.
If I run /tmp/tmp.pl on the command line, it works fine and the file
/tmp/out.log is created.
$> /tmp/tmp.pl
Before STDOUT...
Before STDERR...
Before close STDERR...
End of Prog...
What am I missing?
Thanks.
kat Received on Mon Apr 04 2005 - 07:32:53 CDT