diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c
index 0da8c01422d67d800bd21ba6b04118bf95146a54..f0bcc096253170b9004bfdbe3e3564d291ba14f8 100644
--- a/cdr/cdr_adaptive_odbc.c
+++ b/cdr/cdr_adaptive_odbc.c
@@ -408,6 +408,7 @@ static int odbc_log(struct ast_cdr *cdr)
 	AST_LIST_TRAVERSE(&odbc_tables, tableptr, list) {
 		separator = "";
 
+		quoted = 0;
 		if (tableptr->quoted_identifiers != '\0'){
 			quoted = 1;
 		}