简体   繁体   中英

python simple_salesforce query all

I am using the package simple_salesforce to access Salesforce data. I am querying the tables in Salesforce this way:

from simple_salesforce import Salesforce
sf = Salesforce(username = '', password = '', security_token = '')
sf.query("SELECT Id, Name FROM Main__c LIMIT 2000")

This works perfectly fine, but if I want to query all the columns instead, things start throwing errors.

I tried:

sf.query("SELECT * FROM Main__c LIMIT 2000")
sf.query("SELECT All FROM Main__c LIMIT 2000")

Here is the error:

Response content: No such column 'ALL' on entity 'Main__c'. If you are 
attempting to use a custom field, be sure to append the '__c' after the 
custom field name. Please reference your WSDL or the describe call for the 
appropriate names."}]

I am not sure how to proceed. How can I accomplish querying all the columns?

Salesforce does not support SELECT * FROM Object, you must include the specific fields that you want to be returned from the query, id the way you did in the first query. See the SOQL Syntax Help page here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM