+ Start a Discussion

Why am I getting a "Malformed Query" message?

This is driving me nuts!


A query that I create and test in Ajax Tools returns the information I desire... the same query launched from Apex DataLoader gives me a 'Malformed Query' error (with no meaningful details!)   Here is the SOQL query, can anyone tell me what I'm doing wrong?


SELECT Account.Name, Name, Amount, 

    (SELECT Quantity, UnitPrice, TotalPrice FROM OpportunityLineItem)

FROM Opportunity


Unless I'm blind (or insane) this query is formed exactly as shown on Page 106 of the Force.com Cookbook


So why does it fail when run from the DataLoader - And runs fine from AjaxTools?




BTW I get the same behavior whether I run it from the DataLoader GUI or from the CLI

Message Edited by Megachuckmc on 06-08-2009 05:02 PM
What version of the Data Loader are you using ?

I'm using Apex DataLoader 14.0


The full query that I am trying to run from DataLoader which works from Ajax Tools (2.0) is:


SELECT Account.Name, Name, Amount, Probability, ExpectedRevenue, (SELECT  Quantity, TotalPrice, UnitPrice, pricebookentry.productcode FROM OpportunityLineItems) FROM Opportunity Where amount > 4000000



Account - Name

Opportunity - Name , Amount, Probability, Expected Revenue

OpportunityLineItem - Quantity, UnitPrice, TotalPrice

PricebookEntry - ProductCode


Seems pretty straightforward...

Message Edited by Megachuckmc on 06-08-2009 06:00 PM

ExpectedRevenue opportunity field is not exposed to the api.  You can check this by looking at the opportunity fields listed in Eclipse schema browser.