You need to sign in to do that
Don't have an account?
davidjbb
SQL Syntax
Hello,
I'm having trouble with the following code. I'm fairly new to development so please bare with me.
private String abcd;
private List <WorkReason__c> wrReason;
abcd = "Example"
wrReason = [Select Name from WorkReason__c where Name = abcd];
i''m getting an error where Name = abcd. Are we not allowed to use a varaible in place of 'string value' ?
You are using databinding of a variable so you will need to add in this ":", so try this.
wrReason = [Select Name from WorkReason__c where Name =: abcd];
All Answers
You are using databinding of a variable so you will need to add in this ":", so try this.
wrReason = [Select Name from WorkReason__c where Name =: abcd];
Thank you birdofprey.
This syntax also works: