summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--funcs/func_odbc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index 7f2de02fc..a5f02316f 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -336,6 +336,10 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co
}
}
+ if (stmt) {
+ SQLRowCount(stmt, &rows);
+ }
+
if (stmt && rows == 0 && ast_str_strlen(insertbuf) != 0) {
SQLCloseCursor(stmt);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
@@ -356,7 +360,6 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co
}
} else if (stmt) {
status = "SUCCESS";
- SQLRowCount(stmt, &rows);
}
AST_RWLIST_UNLOCK(&queries);