You need to sign in to do that
Don't have an account?
Jonathan Wolff 7
Create String variable with SQL Where Clause
Hello, I would like to create a string variable that contains a Where-clause. I tried the following:
String AWhereClause= 'AND Typ__c = 'Infobroschüre'';
Unfortunatly that way does not work. Can you give me an solution for that?
String AWhereClause= 'AND Typ__c = 'Infobroschüre'';
Unfortunatly that way does not work. Can you give me an solution for that?
javascriptCopy code
String AWhereClause = "AND Typ__c = 'Infobroschüre'";
Note that we have used double quotes to enclose the string variable, which allows us to include single quotes without needing to escape them. You can use this variable in your SQL query by concatenating it with your SELECT statement or WHERE clause, like this:
javascriptCopy code
String sqlQuery = "SELECT * FROM MyTable WHERE Column1 = 'Value1' " + AWhereClause;
This will result in a SQL query that looks like this:
sqlCopy code
SELECT * FROM MyTable WHERE Column1 = 'Value1' AND Typ__c = 'Infobroschüre'
I hope this helps!
https://www.myaccountaccess.one/