Hi Larry, 

More on Douglas, the execution of queries such DELETE, INSERT or UPDATE
returns the number of "affected" rows.
For no row "affected" the DBI module will return 'OEO'. Meaning 0
multiplied by 10 exp 0.
So in Boolean context it will be true and in numerical context it will
be 0.
If an error occurred it will return undef.

Regards,

Tshimanga.

> -----Original Message-----
> From: Douglas Wilson [mailto:[EMAIL PROTECTED]
> Sent: Tuesday 02 December 2008 02:56
> To: Larry W. Virden
> Cc: [email protected]
> Subject: Re: perl dbi and RaiseError handling - is this a situations
> which won't raise an error?
> 
> On Mon, Dec 1, 2008 at 7:58 AM, Larry W. Virden <[EMAIL PROTECTED]>
> wrote:
> > Now, when the PERSON_ID matches, the update occurs.  When the
> > PERSON_ID is not found, however, an error isn't raised.
> 
> updating zero rows is not an error.
> 
> you can detect it yourself with:
> my $rows = $sth->execute();
> 
> Then rows will be == 0 if zero rows were updated, and you can die
> yourself if you want to call that an error.


Reply via email to