I forgot to mention a couple of things:
When instantiating the DBI object, make sure that you have "RaiseError" set to 1:
my $dbh = DBI->connect("dbi:ODBC:$DSN", $USER, $PASSWORD,
{RaiseError => 1})
By doing that, you won't have to test for errors everywhere. It will automatically throw an exception on an error. Also, if you really want to see what DBI is doing under the hood, try the DBI->trace method. This node has a good example of how it works. (That's a shameless plug because it's one of my nodes :)
Just make sure that you set the trace number low, at first. If it's too high, your output file will be flooded with a bunch of information that is probably meaningless.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats. |