in reply to Re: Database Record Order
in thread Database Record Order

I got the impression that you still had to check for errors on the connect, after which if the RaiseError attribute was set further errors on that database handle would be fatal. From the documentation (emphasis added):
If the connect fails (see below), it returns "undef" and sets both $DBI::err and $DBI::errstr. (It does not set $!, etc.) You should generally test the return status of "connect" and "print $DBI::errstr" if it has failed.
Don't get me wrong: I'd love it if DBI behaved in the manner in which you describe. However, I'm willing to do the error checking once if it does not. :-)

thor

Replies are listed 'Best First'.
3Re: Database Record Order
by jeffa (Bishop) on Dec 31, 2003 at 15:21 UTC

    Actually, if you try to connect() with bogus credentials with either RaiseError turned on or off, your script is going to die regardless of whether you add or die $DBI::errstr or not. I don't bother adding it, because i just don't have to. If the connect fails, my program will die (just run the debugger and see for yourself).

    In other words, DBI does behave in the manner in which i described. But you can still be explicitly redundant, if you want. ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I ran a quick test right before I posted the original, and it had the behavior that you described. What I didn't know is if it was DBI behavior, or the behavior of my specific database driver. As a result of your postings, I'll be changing my style. Thanks!

      thor