Description
There are scenarios when we want to write a query text such as INSERT INTO employees VALUES (10001, John, Doe, johndoe@example.com);
in the Execute query activity, but the values are stored in a variable. For example, the variable “id” contains the value “10001”, the variable “firstName” contains the value “John” and so on.
In this article, we show you how to write a query text in the "Calculate a value" parameter of the Execute query activity.
Instructions
The query text “INSERT INTO employees VALUES (10001, John, Doe, johndoe@example.com)
“ can be written in the ‘Calculate a value’ parameter as follows:
'INSERT INTO employees VALUES("'+id+'","'+firstName+'","'+lastName+'","'+email+'");'
Please note that the syntax varies between the queries and needs to be adjusted accordingly.