Tim,

It looks like DBD::Oracle doesn't support the CursorName attribute.

Regards,

David

Begin forwarded message:

From: "Guest via RT" <[EMAIL PROTECTED]>
Date: Tue Nov 5, 2002 6:11:00 AM US/Pacific
To: "AdminCc of cpan Ticket #1764": ;
Subject: [cpan #1764] Throwing an DBI::st exception fails using DBD::Oracle
Reply-To: [EMAIL PROTECTED]


This message about Exception-Class-DBI was sent to you by guest via rt.cpan.org

Full context and any attached attachments can be found at:
<URL: https://rt.cpan.org/Ticket/Display.html?id=1764 >

I'm using DBI 1.30 and DBD::Oracle 1.12 (RDBMS is 8.0.5)

Given this small program:

--START--
use DBI;
use Exception::Class::DBI;

my $dbh = DBI->connect(
'dbi:Oracle:', 'scott', 'tiger',
{ RaiseError => 0,
PrintError => 0,
HandleError => Exception::Class::DBI->handler, },
);

my $sth = $dbh->prepare("SELECT rowid FROM foo WHERE rowid = ?");
eval { $sth->execute() };
if( UNIVERSAL::isa($@, 'Exception::Class::DBI') ) {
require Data::Dumper;
print Dumper $@;
}
else {
print "non-object exception $@\n";
}
---END---

I get this error back:

non-object exception Can't get DBI::st=HASH(0x2004515c)->{CursorName}: unrecognised attribute at /home_dir/jfitzgi/myperl/lib/Exception/Class.pm line 225.

From a grep of the DBD::Oracle source code, it would appear that CursorName is not supported with this DBD. Unfortunately, when an unrecognized attribute is asked for inside of a DBI ErrorHandler, the handler seems to die, so the exception thrown is just a plain string, not an Exception::Class object.

If I comment out this line in Exception/Class/DBI.pm, the problem goes away:

cursor_name => $dbh->{CursorName},

and I get an Exception::Class::DBI::STH thrown from the execute call. It would appear that (at least in my environment) that CursorName is the only attribute that is missing from the DBI implementation.

The DBI documentation says that CursorName should return undef if the database engine doesn't support that feature. I'm going to post this report to dbi-users and see if anyone there can shed some light on things.

Thanks.

--
David Wheeler                                     AIM: dwTheory
[EMAIL PROTECTED]                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e
                                               Jabber: [EMAIL PROTECTED]

Reply via email to