Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://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 esoftmatic.com 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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-03-29 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found