You need to sign in to do that
Don't have an account?
VINODKUMAR REDDY KALUVA
Like Operator is not working with Dynamic Variable in SOQL Query
Hi,
Here I'm trying to perform LIKE operation in SOQL when I'm passing dynamically its not returning results?
LIKE '%+ companies +%'
LIKE: '%companies %'
LIKE:('%'+companies+'%')
Any One Please help me?
Thanks In Advance!..
Here I'm trying to perform LIKE operation in SOQL when I'm passing dynamically its not returning results?
List<string> companies=new list<string>(); List<Account> leadAccountIds=[Select Id, OwnerId, Name FROM Account WHERE Name LIKE : '%' + companies + '%'];I tried Like below ways
LIKE '%+ companies +%'
LIKE: '%companies %'
LIKE:('%'+companies+'%')
Any One Please help me?
Thanks In Advance!..
Hi,
Try below code
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
Best Regards
Sandhya
Let me know if the same resolves your query.
List<string> companies=new list<string>();
companies.add('%test%');
companies.add('%pawan%');
List<Account> accountList = [Select Id, OwnerId, Name FROM Account WHERE Name LIKE : companies];
System.debug(accountList);
Please mark it best if it helps you. Thanks.