diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c
index 092aa14dd374959edf15a2126319b065b6892f71..7e5a7f856e1fa0fe4475ce08cc8309de70b25c9a 100644
--- a/cdr/cdr_adaptive_odbc.c
+++ b/cdr/cdr_adaptive_odbc.c
@@ -305,7 +305,7 @@ static int odbc_log(struct ast_cdr *cdr)
 	char *sql = ast_calloc(sizeof(char), sizesql), *sql2 = ast_calloc(sizeof(char), sizesql2), *tmp;
 	char colbuf[1024], *colptr;
 	SQLHSTMT stmt = NULL;
-	SQLINTEGER rows = 0;
+	SQLLEN rows = 0;
 
 	if (AST_RWLIST_RDLOCK(&odbc_tables)) {
 		ast_log(LOG_ERROR, "Unable to lock table list.  Insert CDR(s) failed.\n");