in reply to My update on insert error solution
The manpage for DBI is quite extensive for what an execute() returns. It includes undef, integers and 0E0. It also says that :
If execute() is called on a statement handle that's still active ($sth->{Active} is true) then it should effectively call finish() to tidy up the previous execution results before starting this new execution.
It is not clear to me if "should effectively call finish()" is yours or execute()'s responsibility.
DB errors become fatal if you set RaiseError=>1. However, if you see the "Doing update" message then obvioudly this isn't the case.
A few days ago I was in similar insert/update situation and decided to check first if a record already exists before updating or inserting using something I found on the net: SELECT EXISTS(SELECT 1 FROM tablename WHERE abc LIMIT 1) which returns 0 or 1.
|
|---|