PATCH: update of non existing row returns {error,"No SQL-driver information available."}
Paul Oliver
puzza007@REDACTED
Thu Nov 26 15:04:34 CET 2009
I've changed the patch to follow the advice given on MSDN
(http://msdn.microsoft.com/en-us/library/ms715424%28VS.85%29.aspx) and
check for SQL_NO_DATA combined with SQLSTATE 00000. The resulting
patch is on github:
http://github.com/puzza007/otp/tree/odbc_update_delete_no_rows
Cheers,
Paul.
On Tue, Nov 24, 2009 at 11:02 AM, Paul Oliver <puzza007@REDACTED> wrote:
> Hi all,
>
> I noticed the following when no rows were updated for an update statement:
>
> 4> odbc:param_query(Ref, "update tbadger set status = ? where
> badger_id = ?", [{{sql_varchar,1},["R"]}, {sql_integer, [61111]}]).
> {error,"No SQL-driver information available."}
> 5> odbc:param_query(Ref, "update tbadger set status = ? where
> badger_id = ?", [{{sql_varchar,1},["R"]}, {sql_integer, [61]}]).
> {updated,1}
>
> The attached patch, which requires the ODBC patch from Andrew
> Thompson, should fix it:
>
> 3> odbc:param_query(Ref, "update tbadger set status = ? where
> badger_id = ?", [{{sql_varchar,1},["R"]}, {sql_integer, [61111]}]).
> {updated,0}
> 4>
>
> Cheers,
> Paul.
>
More information about the erlang-patches
mailing list