Tim Bunce wrote:
On Fri, Sep 02, 2005 at 05:37:57PM -0500, johnnnnnn wrote:

Capacio, Paula J wrote:


my $stmt = 'select count(*) from sysibm.badTblnm ';
my $sth = $dbh->prepare($stmt) or die "Prepare Failed\n";

DBD::DB2 doesn't seem to return false values for failures.


If that's true then it's broken.

It may just be that the prepare() doesn't send the sql to the server
until it's execute()'d - so any sql errors won't be noticed till then.

Tim -- that's exactly the case. We're using deferred prepare by default in the DBD::DB2 driver.

That's quite common across many drivers (as it saves round-trips to the
server) and is, I think, mentioned in the DBI docs from prepare().

If you want to disable deferred prepare, you can:
* set the db2_deferred_prepare statement attribute to false
* or set "DeferredPrepare = 0" in your db2cli.ini file

Thanks,
Dan

P.S. Sorry for the delay -- just sold our house and have been focused on life outside of computers for the last month or so :)

Reply via email to