The most common issue with INSERT statement and Integration Server is the fact that developers are usually forgetting to add quotes to the string variable types.
For example, if you have the following two variables in your dial plan:
${var_name}=’John’
${var_age}=45
that correspond to two fields in tabel_abc, the following INSERT statement will not work correctly:
INSERT INTO table_abc VALUES (${var_name},${var_age});
When Asterisk replaces channel variable values this INSERT statement looks like this:
INSERT INTO table_abc VALUES (John,45);
And this will cause the error since John is not under the quotes and database engine will not match the variable type with the database field type.
The correct INSERT statement would be:
INSERT INTO table_name VALUES (‘${var_name}’,${var_age})
When Asterisk replaces channel variable values, this statement will look like this:
INSERT INTO table_name VALUES (‘John’,45)
and that will be successfully inserted into the database.