invoking sqlplus from perl show no output

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LaoDe
    New Member
    • Sep 2006
    • 9

    invoking sqlplus from perl show no output

    Hi,

    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
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    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:

    Code:
    $C = `sqlplus $DBUSER/$DBPW \@getcolnam.sql $TABNAM $TABOWNER`;
    Regards,

    Jeff

    Comment

    Working...