in reply to Re: Re: sqlplus or DBI
in thread sqlplus or DBI

Remember that using backticks to execute a call is not the same as using system(). The latter returns the exit status...the former the output of the call. So when I call a sql script that will exit with sql.sqlerror and it fails with ORA-2292... the errorcode will indeed be the value in $result as long as it is called with backticks or qx//.
Jason

Replies are listed 'Best First'.
Re: Re: Re: Re: sqlplus or DBI
by x31forest (Novice) on Nov 19, 2002 at 16:33 UTC
    Even when using backticks you can retrive the last exit status using $? or $CHILD_ERROR.
Re: Re: Re: Re: sqlplus or DBI
by tommyw (Hermit) on Nov 19, 2002 at 16:16 UTC

    Well, actually, I have to apologise: I didn't read your post to the bottom and didn't notice that you were parsing the output rather than looking at the status code.

    But my point was actually about exit SQL.SQLCODE, because it's at best useless (as you intend it to be), or at least confusing, and at worst dangerous (for the reasons I gave above).

    --
    Tommy
    Too stupid to live.
    Too stubborn to die.