I want to save a query as a string with "variable-name" in a file as -
SELECT Id FROM Object WHERE name = "+ VARIABLE_NAME + "
and want to execute query like -
public void executeQuery(String VARIABLE_NAME)
{
String query = ReadQuery(); // some method which reads queryfrom file.
ExecuteQuery(query ); // value of VARIABLE_NAME should be included from parameter
}
I want to variable Value should be included from parameter. I can not use it like this -
command.Parameters.AddWithValue("@VARIABLE_NAME", VARIABLE_NAME);
Please provide me a solution.
Thanks in advance.
Note : This is SOQL query, not SQL query.