Python Simple Salesforce Select AS Not WorkingHow to rename a column in a query in ORACLEHow can I represent an 'Enum' in Python?Way to create multiline comments in Python?What is the Python 3 equivalent of “python -m SimpleHTTPServer”Using Python 3 in virtualenvWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?Accessing salesforce metadata using python simple-salesforceTypeError: cannot concatenate 'str' and 'SFType' objects (simple-salesforce)Salesforce Data into Python (simple-Salesforce or salesforce-bulk)Python Simple Salesforce Select All Fieldspython cache false - not working

How to deal with fear of taking dependencies

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

What does 'script /dev/null' do?

What is the meaning of "of trouble" in the following sentence?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Why is the design of haulage companies so “special”?

What do the Banks children have against barley water?

Is this food a bread or a loaf?

What is it called when one voice type sings a 'solo'?

What is the command to reset a PC without deleting any files

extract characters between two commas?

Is there a familial term for apples and pears?

Why doesn't a const reference extend the life of a temporary object passed via a function?

Why airport relocation isn't done gradually?

Finding files for which a command fails

COUNT(*) or MAX(id) - which is faster?

Why Is Death Allowed In the Matrix?

How to manage monthly salary

What are the advantages and disadvantages of running one shots compared to campaigns?

Typesetting a double Over Dot on top of a symbol

Copycat chess is back

Where to refill my bottle in India?

I see my dog run

Need help identifying/translating a plaque in Tangier, Morocco



Python Simple Salesforce Select AS Not Working


How to rename a column in a query in ORACLEHow can I represent an 'Enum' in Python?Way to create multiline comments in Python?What is the Python 3 equivalent of “python -m SimpleHTTPServer”Using Python 3 in virtualenvWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?Accessing salesforce metadata using python simple-salesforceTypeError: cannot concatenate 'str' and 'SFType' objects (simple-salesforce)Salesforce Data into Python (simple-Salesforce or salesforce-bulk)Python Simple Salesforce Select All Fieldspython cache false - not working






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm trying the standard SELECT ... AS call to rename a column in query output with the Python Salesforce API and it's throwing following error:



 ... unexpected token: 'AS'", 'errorCode': 'MALFORMED_QUERY'}


So far most native language calls from SOQL have been working in the API and it seems, from here, that SELECT ... AS is valid SOQL.



Query outline:



from simple_salesforce import Salesforce
sf = Salesforce(username=myusername, password=mypassword, security_token=mytoken)
query = "select closedate as Date from opportunity"
query_list = sf.query_all(query)['records']


edit
error remains even after putting the new column name within quotes as advised in above link:



query = "select closedate as "Date" from Opportunity"


Thanks










share|improve this question
























  • Oracle SQL is not the same as SOQL; the question you've linked cannot help you, unfortunately. In fact, based on this feature request it's currently impossible to alias a column in SOQL unless you're aliasing the result of an aggregate function.

    – Terminus
    Mar 12 at 1:05

















0















I'm trying the standard SELECT ... AS call to rename a column in query output with the Python Salesforce API and it's throwing following error:



 ... unexpected token: 'AS'", 'errorCode': 'MALFORMED_QUERY'}


So far most native language calls from SOQL have been working in the API and it seems, from here, that SELECT ... AS is valid SOQL.



Query outline:



from simple_salesforce import Salesforce
sf = Salesforce(username=myusername, password=mypassword, security_token=mytoken)
query = "select closedate as Date from opportunity"
query_list = sf.query_all(query)['records']


edit
error remains even after putting the new column name within quotes as advised in above link:



query = "select closedate as "Date" from Opportunity"


Thanks










share|improve this question
























  • Oracle SQL is not the same as SOQL; the question you've linked cannot help you, unfortunately. In fact, based on this feature request it's currently impossible to alias a column in SOQL unless you're aliasing the result of an aggregate function.

    – Terminus
    Mar 12 at 1:05













0












0








0


1






I'm trying the standard SELECT ... AS call to rename a column in query output with the Python Salesforce API and it's throwing following error:



 ... unexpected token: 'AS'", 'errorCode': 'MALFORMED_QUERY'}


So far most native language calls from SOQL have been working in the API and it seems, from here, that SELECT ... AS is valid SOQL.



Query outline:



from simple_salesforce import Salesforce
sf = Salesforce(username=myusername, password=mypassword, security_token=mytoken)
query = "select closedate as Date from opportunity"
query_list = sf.query_all(query)['records']


edit
error remains even after putting the new column name within quotes as advised in above link:



query = "select closedate as "Date" from Opportunity"


Thanks










share|improve this question
















I'm trying the standard SELECT ... AS call to rename a column in query output with the Python Salesforce API and it's throwing following error:



 ... unexpected token: 'AS'", 'errorCode': 'MALFORMED_QUERY'}


So far most native language calls from SOQL have been working in the API and it seems, from here, that SELECT ... AS is valid SOQL.



Query outline:



from simple_salesforce import Salesforce
sf = Salesforce(username=myusername, password=mypassword, security_token=mytoken)
query = "select closedate as Date from opportunity"
query_list = sf.query_all(query)['records']


edit
error remains even after putting the new column name within quotes as advised in above link:



query = "select closedate as "Date" from Opportunity"


Thanks







python-3.x simple-salesforce






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 7:25







shanlodh

















asked Mar 8 at 7:17









shanlodhshanlodh

159212




159212












  • Oracle SQL is not the same as SOQL; the question you've linked cannot help you, unfortunately. In fact, based on this feature request it's currently impossible to alias a column in SOQL unless you're aliasing the result of an aggregate function.

    – Terminus
    Mar 12 at 1:05

















  • Oracle SQL is not the same as SOQL; the question you've linked cannot help you, unfortunately. In fact, based on this feature request it's currently impossible to alias a column in SOQL unless you're aliasing the result of an aggregate function.

    – Terminus
    Mar 12 at 1:05
















Oracle SQL is not the same as SOQL; the question you've linked cannot help you, unfortunately. In fact, based on this feature request it's currently impossible to alias a column in SOQL unless you're aliasing the result of an aggregate function.

– Terminus
Mar 12 at 1:05





Oracle SQL is not the same as SOQL; the question you've linked cannot help you, unfortunately. In fact, based on this feature request it's currently impossible to alias a column in SOQL unless you're aliasing the result of an aggregate function.

– Terminus
Mar 12 at 1:05












1 Answer
1






active

oldest

votes


















0














The syntax seems to be incorrect.



Try query = "select closedate <insert alias> from Opportunity" according to the alias notation documented here : https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_alias.htm






share|improve this answer

























  • The link doesn't say anything about column aliases...

    – Terminus
    Mar 12 at 1:08











  • Does it not describe alias notation in a select statement?

    – bmat
    Mar 12 at 7:17











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058460%2fpython-simple-salesforce-select-as-not-working%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The syntax seems to be incorrect.



Try query = "select closedate <insert alias> from Opportunity" according to the alias notation documented here : https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_alias.htm






share|improve this answer

























  • The link doesn't say anything about column aliases...

    – Terminus
    Mar 12 at 1:08











  • Does it not describe alias notation in a select statement?

    – bmat
    Mar 12 at 7:17















0














The syntax seems to be incorrect.



Try query = "select closedate <insert alias> from Opportunity" according to the alias notation documented here : https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_alias.htm






share|improve this answer

























  • The link doesn't say anything about column aliases...

    – Terminus
    Mar 12 at 1:08











  • Does it not describe alias notation in a select statement?

    – bmat
    Mar 12 at 7:17













0












0








0







The syntax seems to be incorrect.



Try query = "select closedate <insert alias> from Opportunity" according to the alias notation documented here : https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_alias.htm






share|improve this answer















The syntax seems to be incorrect.



Try query = "select closedate <insert alias> from Opportunity" according to the alias notation documented here : https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_alias.htm







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 12 at 7:19

























answered Mar 8 at 13:20









bmatbmat

11414




11414












  • The link doesn't say anything about column aliases...

    – Terminus
    Mar 12 at 1:08











  • Does it not describe alias notation in a select statement?

    – bmat
    Mar 12 at 7:17

















  • The link doesn't say anything about column aliases...

    – Terminus
    Mar 12 at 1:08











  • Does it not describe alias notation in a select statement?

    – bmat
    Mar 12 at 7:17
















The link doesn't say anything about column aliases...

– Terminus
Mar 12 at 1:08





The link doesn't say anything about column aliases...

– Terminus
Mar 12 at 1:08













Does it not describe alias notation in a select statement?

– bmat
Mar 12 at 7:17





Does it not describe alias notation in a select statement?

– bmat
Mar 12 at 7:17



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058460%2fpython-simple-salesforce-select-as-not-working%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко