in reply to Re: DBI data types
in thread DBI data types
This is a common mistake. You rarely need to call finish on a statement handle, and you should never call it for an insert statement. You should only call it on a select handle where you do not fetch the entire result set (the select after the last record). It exists to tell the database that you are done with any temporary resources required by the statement (e.g. temp tables for an order by, etc.).
I've never used bind_param, and as far as I can tell, it's completely unnecessary for what you are trying to do.
Bind_param is occasionally necessary to tell DBI what type of argument you have when DBI guesses wrong (though I admit I've never used it either and it probably IS unnecessary in this instance).
Update: I've also seen a case recently on the DBI list where a field is character, but the first value bound to it is numeric, so DBI (or the DBD?) assumes that the field is numeric and doesn't need quoting, which of course breaks when the value bound is non-numeric. Don't quote me on this, my memory is vague :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: bind_param
by htoug (Deacon) on Aug 22, 2001 at 15:02 UTC | |
|
Re: Re: Re: DBI data types
by Dalin (Sexton) on Aug 21, 2001 at 23:54 UTC |