Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: What is truth? (Curiosity corner)

by htoug (Deacon)
on Jan 08, 2002 at 15:54 UTC ( #137104=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: What is truth? (Curiosity corner)
in thread What is truth? (Curiosity corner)

"0E0" is used by the DBI (and DBD's) for eg. $sth->execute when the SQL-statement processed 0 rows but did not error.

This allows constructions like my $rows=$sth->execute or die "SQL error" ( Of course this would be expressed better using $dbh->{RaiseError} = 1).

The relevant part of the DBI documentation states:

For a non-`SELECT' statement, `execute' returns the number of rows affected, if known. If no rows were affected, then `execute' returns "`0E0'", which Perl will treat as 0 but will regard as true. Note that it is not an error for no rows to be affected by a statement. If the number of rows affected is not known, then `execute' returns -1.


Comment on Re: Re: Re: What is truth? (Curiosity corner)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://137104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-12-21 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (101 votes), past polls