467,109 Members | 1,367 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,109 developers. It's quick & easy.

invoking sqlplus from perl show no output


I want to catch a select-result into perl-variable, like this (on Linux):

$C = system ("sqlplus $DBUSER/$DBPW \@getcolnam.sql $TABNAM $TABOWNER ");

Wenn I run this, I see Oracle's output properly, but I can't catch the result in a perl variable. $C is empty, I also tried @C but there is nothing in.

I used exactly this mehtod years ago without any problems.

How can I findout, what the problem is ? How get more feedback from system call ?

I'm not a real UNIX-Freak and have no ideas about all those UNIX-system internals to find out, I'm just an oracle-guy.

thanks for any tip, Lao De
Aug 25 '08 #1
  • viewed: 5026
1 Reply
Expert Mod 2GB
If you are wanting to capture the output of a system run command, you don't want to use the system() function as all it returns is the exit status of what it ran. Instead, just use backtics as follows:

Expand|Select|Wrap|Line Numbers
  1. $C = `sqlplus $DBUSER/$DBPW \@getcolnam.sql $TABNAM $TABOWNER`;

Aug 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Mark Wilson CPU | last post: by
4 posts views Thread by Raj Kotaru | last post: by
4 posts views Thread by tommy | last post: by
2 posts views Thread by Arijit Chatterjee | last post: by
reply views Thread by tyousaf | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.