Index: funcs/func_odbc.c =================================================================== --- funcs/func_odbc.c (revision 304952) +++ funcs/func_odbc.c (working copy) @@ -325,6 +325,10 @@ } } + if (stmt) { + SQLRowCount(stmt, &rows); + } + if (stmt && rows == 0 && ast_str_strlen(insertbuf) != 0) { SQLCloseCursor(stmt); SQLFreeHandle(SQL_HANDLE_STMT, stmt); @@ -347,7 +351,6 @@ } } else if (stmt) { status = "SUCCESS"; - SQLRowCount(stmt, &rows); } AST_RWLIST_UNLOCK(&queries);