+ Start a Discussion
CrocketCrocket 

SOQL Concatenation Operator

The information I have found suggests SOQL does not have a string concatenation operator. For example, in Oracle the following statement would be allowed in the WHERE clause:

 

 

MyContact__c.HOME_ADDRESS1__c || MyContact__c.HOME_ADDRESS2__c = Contact.OtherAddress

 

However, using a number of tools (e.g. Force.com Explorer) I find the above concatenation operator is not supported, both in the WHERE clause and SELECT field list. I have also tried other concatenation operators (e.g. +, &) and have found none that are supported. Is SOQL's non-support of string concatenation within a query documented anywhere?

 

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The docs have the following to say:

 

--- snip ---

 

SOQL does not support all advanced features of the SQL SELECT command. For example, you cannot use SOQL to perform arbitrary join operations, use wildcards in field lists, or use calculation expressions.

 

--- snip ---

 

i doubt that there will be specific documentation for what SOQL cannot do - how you can use it is documented at:

 

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_calls_soql.htm|StartTopic=Content%2Fsforce_api_calls_soql.htm|SkinName=webhelp

All Answers

IspitaIspita

Hi,

Do you want the link to SOQL documentation?

bob_buzzardbob_buzzard

The docs have the following to say:

 

--- snip ---

 

SOQL does not support all advanced features of the SQL SELECT command. For example, you cannot use SOQL to perform arbitrary join operations, use wildcards in field lists, or use calculation expressions.

 

--- snip ---

 

i doubt that there will be specific documentation for what SOQL cannot do - how you can use it is documented at:

 

http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_calls_soql.htm|StartTopic=Content%2Fsforce_api_calls_soql.htm|SkinName=webhelp

This was selected as the best answer
CrocketCrocket

Bob:

 

I had read the information you posted. Given how much I had seen concatenation used in SQL I found it odd that there was no mention of it. However, given your credentials your answer is just as good. Thanks.