"Handle Attributes" are different to "Method Attributes".
The only exception to this is DBI->connect.
In DBI v2 that exception will (probably) be generalized so that any
method that creates a new handle, such as $dbh->prepare() can be given
"Handle Attributes" to apply to that new handle.
Tim.
On Sun, Apr 04, 2004 at 01:57:51AM +0200, Bart Lateur wrote:
> I've been playing a little with the module Tie::DBI, and I noticed that
> it died for me, using a DBI handle I provided, on this line:
>
> my $sth = $dbh->prepare("LISTFIELDS $table");
>
> (line 376 in the latest Tie::DBI, 0.93)
>
> The reason is because I connected using:
>
> { RaiseError => 1, PrintError => 0 }
>
> I tried to disable RaiseError in this one line like this:
>
> my $sth = $dbh->prepare("LISTFIELDS $table", { RaiseError => 0,
> PrintError => 0 });
>
> because, well, the DBI docs list these attributes under "ATTRIBUTES
> COMMON TO ALL HANDLES" -- even though the synopsis for prepare() didn't
> mention it. A futile attempt: it didn't work.
>
> Question: why not? Attempting one statement that you know might fail
> looks like a reasonable viewpoint.
>
> Yes I know I might use eval for my particular case, but that won't help
> for people that have PrintError on.
>
> --
> Bart.