+ Start a Discussion
SipuSipu 

Case Sensitivity Problem in SOQL Query

I have created a custom external Id field [Unique Case Sensitive] in a custom object. I have inserted two records having External Id data as 'abc123' and 'ABC123' .  while querying for 'abc123' I am getting both the records. But I want only 1 record whose external Id is 'abc123' How to over come from this Issue.  

My Query : SELECT * from customObject__c where externalSystemId__c = 'abc123' ;  

note: If I do the same in standard object only 1 record comes. 
Best Answer chosen by Sipu
PratikPratik (Salesforce Developers) 
Hi Sameer,

Comparisons on strings are case-insensitive.
Please refer to:
https://www.salesforce.com/us/developer/docs/dbcom_soql_sosl/Content/sforce_api_calls_soql_select_comparisonoperators.htm

Thanks,
Pratik

All Answers

PratikPratik (Salesforce Developers) 
Hi Sameer,

Comparisons on strings are case-insensitive.
Please refer to:
https://www.salesforce.com/us/developer/docs/dbcom_soql_sosl/Content/sforce_api_calls_soql_select_comparisonoperators.htm

Thanks,
Pratik
This was selected as the best answer
SipuSipu
Thanks Pratik for your reply. But in standard object when i am doing the same it's working as case sentive. How can it possible ?
Nipun KalalNipun Kalal
Hi Sipu,
did you find out how to make it case insensitive and why is it case sensitive for standard object?
Thanks.