oracle - pipe.stdout.read() returning NULL (Calling Perl Script from Python) -
i have perl script 'db.pl' connects oracle db , fetches row table.
use dbi; use lib " c:\strawberry\perl\site\lib"; $dbh = dbi->connect("<schema>", "<username>", '<password>', { raiseerror => 1 }); $sth = $dbh->prepare('select * <tablename>',{ raiseerror => 1 }); $sth->execute; @row = $sth->fetchrow_array; print "@row\n"
now when running through command prompt, returning 1 row want.
>perl db.pl
now, want same result in python , using following code:
>>> pipe = subprocess.popen(["perl", "<path>/db.pl"], stdout=subprocess.pipe) >>> print pipe.stdout.read()
this returns null. can tell going wrong?
Comments
Post a Comment