You need to sign in to do that
Don't have an account?
jmarie1228
SOQL Unexpected token error on simple where clause??
Hi-
I'm trying to grab a list of contact records where the ownerID of the contact is not the same as the ownerID of the account the contact belongs to so I can fix these records (I now have a trigger in place to handle this). Using the Apex Explorer, the following code throws an "unexpected token" error on the where clause. What the heck am I doing wrong?? Any help is GREATLY appreciated!
Code:
Select c.AccountId, c.Account.OwnerId, c.Id, c.OwnerId from Contact c where c.OwnerId != c.Account.OwnerId
Hi, I am having a simuilar problem where I get Unexpected Token but I am creating the query as a string in order to display the query results ion a web page using a ApexPages.StandardController method. The problem I am having is concatenating the string variable I get from a pick list option to the string query. Here is my code and variable subscriptionnames is the variable containing the selected pick list option. Thanks much for your help.:
String query = 'Select Id, Account__r.Id, Account__r.Name, '+
'Account__r.Mailing_Attention__c, '+
'Account__r.Mailing_Street_1__c, ' +
'Account__r.Mailing_Street_2__c, ' +
'Account__r.Mailing_Street_3__c, ' +
'Account__r.Mailing_State_Province__c, ' +
'Account__r.Mailing_Zip_Postal_Code__c, '+
'Name, ' +
'Product__r.Name, ' +
'Description__c, ' +
'Quantity__c, ' +
'Last_Renewal_Date__c, ' +
'Number_of_Issues__c, ' +
'Last_Issue_Sent__c '+
'From Subscription__c \'' + subscriptionnames + '\' '; <----- Problem
Folks I am sorry. I found the answer. I had forgotten to place a WHERE clause in my query string and then attach the variable using the single quote method that was listed im my last question. Once that WHERE cluse is inserted everything works fine for the ApexPages.StandardSetController() method and SOQL query.