Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Beginner DBI problem

Thread Tools

Beginner DBI problem

Matt Garrish
Posts: n/a

"Gunnar Hjalmarsson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Matt Garrish wrote:
>> Gunnar Hjalmarsson wrote:
>>>Matt Garrish wrote:
>>>>$sth->execute() or die DBI->errstr;
>>>Shouldn't that be
>>> $sth->execute() or die $sth->errstr;
>>>? Or doesn't it matter?

>> It doesn't matter. errstr is global to the DBI package, so any valid
>> object should be able to access its value. In this case:
>> DBI->errstr;
>> $dbh->errstr;
>> $sth->errstr;
>> could all be used to print an error executing the statement.

> Okay, thanks.
>> It's probably not wise to use the statement handle itself, though,
>> because it's the most likely candidate not to have a valid object.

> Don't follow you there, Matt. If $sth isn't a valid object reference, the
> errstr method won't tell you why $sth->execute() failed, will it?

Sorry, was in a rush this morning. I was thinking you would get both an
error for trying to call the execute method and an error for trying to call
errstr (i.e., redundant messages). Obviously that's not the case.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
DBI Mysql storing DBI:binary, trouble with character 26 Jerome Hauss Ruby 0 10-13-2004 03:04 PM
DBI and DBI::Oracle packages configuration ulloa Perl 1 07-22-2004 05:52 PM
DBI problem : How can I load quickly one huge table with DBI ??. Tim Haynes Perl Misc 3 09-13-2003 03:43 AM
Mason, DBI, and DBI::Pg Asby Perl Misc 0 07-24-2003 09:04 PM