By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,811 Members | 1,978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,811 IT Pros & Developers. It's quick & easy.

invoking sqlplus from perl show no output

P: 9

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
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 3,503
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.