tommcneill has asked for the wisdom of the Perl Monks concerning the following question:

Hi: I'm a new to this and was hoping y'all might be able to shed a little light on a utterly odd error that has just popped up. I'm writing a plain jane cgi that takes user entered information, parses it, checks an oracle database, then decides what SQL statement it needs to execute. The problem is in the check. ($x, $y, $z) = $dbh->selectrow_array($sqlCmd); Essentially I'm checking to see if any part of the material exists in the database. Here's the strange part, it exits with Inappropriate ioctl for device The sql command executes flawlessly in SQLPlus. I'm using perl 5.6 Any ideas? thanks, tom.

Replies are listed 'Best First'.
Re: cgi oracle ioctl error
by dragonchild (Archbishop) on Jul 13, 2004 at 15:28 UTC
    In addition to the info requested by gellyfish, some other useful info might be:
    • Your operating system
    • Your Oracle version
    • Your exact Perl version. 5.6.0 is different in some ways than 5.6.1
    • Your DBI and DBD::Oracle versions
    • The way you connect to the database
    • The statement contained in $sqlCmd

    Also, I'd make sure I was using strict and warnings. Those can help find bugs that throw weird errors.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

    I shouldn't have to say this, but any code, unless otherwise stated, is untested

Re: cgi oracle ioctl error
by gellyfish (Monsignor) on Jul 13, 2004 at 15:20 UTC

    it exits with Inappropriate ioctl for device
    I assume that you are printing out the value of $! - this only contains the last OS error and is likely to have something completely erroneous in it unless you have detected an error from a perl function that will have made a system call at some point. Can you show us the code that you are using to detect the error.

    /J\

Re: cgi oracle ioctl error
by Fletch (Bishop) on Jul 13, 2004 at 15:29 UTC

    Check perldoc DBI for the RaiseError and PrintError attributes, as well as $dbh->errstr or $DBI::errstr which might have a more relevant error message.