See my comments below.
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
> > Of course, in an ideal world, DBD's would all set $DBI::state
> > ($h->state) to the appropriate value: "23000"
>
> In the interest of mysql 3.2x and 4.x, are the state values dependable? In
> any case, I'm interested in:
>
> - insert failed on duplicate keys
I've added this to the list - researching this now.
> - no data found on query
This info is already available using regular DBI
functionality. Read 'perldoc DBI' - here's a snippet
under the "rows" method:
For "SELECT" statements, it is generally not possible to know how
many rows will be returned except by fetching them all. Some
drivers will return the number of rows the application has fetched
so far, but others may return -1 until all rows have been fetched.
So use of the "rows" method or $DBI::rows with "SELECT" statements
is not recommended.
> - update count as in 0 for no update
This info is already available using regular DBI
functionality. Read 'perldoc DBI' - search for 'rows'.
Existing DBI methods let you know how many rows were
affected by your update.
> - syntax error for any of the above
This info is already available using regular DBI
functionality. If there are syntax errors in your SQL, the
'prepare' method should fail. Make sure you read about
error trapping, transactions, and eval.
>
> Assuming I exprience with SQL databases, any good tutorial site using DBI?
'perldoc DBI' to see the excellent included documentation -
I'd start there first.
HTH.
--
Hardy Merrill
Red Hat, Inc.