Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
This script runs fine on Solaris...
#!/usr/local/bin/perl use warnings; use strict; use DBI; my $dbh = DBI->connect("DBI:Oracle:"."a_database", "a_user", "a_password", {AutoCommit => 1, PrintError => 0, RaiseError => 0 }) or die "Couldn't connect to a_database: " . $DBI::errstr; my $res = $dbh->selectall_arrayref("select 1 from dualXXX"); unless ($DBI::err == 0) { print "SQL Failed: ${DBI::err}\n${DBI::errstr}\n"; } else { print "Successful\n"; } $dbh->disconnect();
and as expected returns
SQL Failed: 942 ORA-00942: table or view does not exist (DBD ERROR: OCIStmtExecute/Des +cribe)
However, running the same script on the WinXP cmd shell the script bombs with one of those annoying Windows popups about telling microsoft the problem.

How can I trap my SQL failure in WinXP? I've tried using eval but that makes no difference.

Update 1

I downloaded the DBI and the Oracle DBD from here following their instructions and used their DBI version instead of the ActiveState one but still no joy.

Update 2

Finally got it working.

As above the ActiveState DBI package is not compatible with the Oracle DBD build but by stumbling around in my usual chaotic manner I chanced upon the combo of DBI and DBD versions that work.

Apologies for wasting everyones time.

In reply to Same Script different OS by Jonathan

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (2)
    As of 2021-01-27 01:06 GMT
    Find Nodes?
      Voting Booth?