Dashboard > Mule FAQ - Open Source ESB and Integration Platform > ... > Frequently Asked Questions (FAQ) > How to resolve The Query syntax is incorrect use select or find statements with SFDC connector
  Mule FAQ - Open Source ESB and Integration Platform Log In | Sign Up   View a printable version of the current page.  
  How to resolve The Query syntax is incorrect use select or find statements with SFDC connector

Added by Kynan Fraser , last edited by Kynan Fraser on Jun 26, 2007
Labels: 
(None)

If you are trying to run a SOQL query (as opposed to SOSL search) as your inbound endpoint against SFDC using Select and are getting a stack trace similar to the following:

ERROR 2007-06-27 13:01:10,621 [SalesForceConnector.sf.getData.receiver.1] org.mule.impl.DefaultExceptionStrategy: Caught exception in Exception Strategy: The Query syntax is incorrect: use select or find statements 
java.lang.Exception: The Query syntax is incorrect: use select or find statements 
	at org.mule.transports.sfdc.SalesForceMessageReceiver.getMessages(SalesForceMessageReceiver.java:85)
	at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:116)
	at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:71)
	at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
	at java.lang.Thread.run(Thread.java:595)

and your configuration file looks something like:

<connector name="SalesForceConnector"
	className="org.mule.transports.sfdc.SalesForceConnector">
	<properties>
		<property value="" name="username" />
		<property value="" name="password" />
		<map name="queries">
			<property name="getData" value="Select Id,FirstName,LastName,Phone,Title from Contact where ..."/>
		</map>	
		<map name="searches">
			<property name="searchData" value="..."/>
		</map>		
	</properties>
</connector>
...
<mule-descriptor name="..."
	implementation="...">
	<inbound-router>				
		<endpoint address="sf://getData"/>																					
	</inbound-router>

the problem is that the query is case sensitive and keywords need to be in lower case.

Strangely enough if you execute this query using a UMO Component (implementation class) like this:

String query = "Select Id,FirstName,LastName,Phone,Title From Contact Where FirstName='...'";
UMOMessage msg = context.receiveEvent("sf://soql?" + query, 0);

it works.

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators