<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python Payload  WHERE clause syntax error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372366#M69693</link>
    <description>&lt;P&gt;Is there any reason to use an f-string here? Does this work?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;whereclause='1=1'
gis_payload = {
    'token': portaltoken,
    'f': 'json',
    'where': whereclause
}
print(gis_payload)
response = requests.request("POST", url=url, data=gis_payload)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 19 Jan 2024 17:15:15 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2024-01-19T17:15:15Z</dc:date>
    <item>
      <title>Python Payload  WHERE clause syntax error</title>
      <link>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372266#M69692</link>
      <description>&lt;P&gt;I am creating a data parameter to pass to my Rest Service to Delete a bunch of records.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This works great on my laptop via VPN into my work servers&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When a DBA runs this from the server itself I get a syntax error on the WHERE clause... I am very puzzled... wondering if anyone has seen this before...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again it runs fine from my computer but its not on the server....&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;        whereclause='1=1'
        gis_payload = {
            'token': portaltoken,
            'f': 'json',
            'where': f'''{whereclause}'''
            }
        print(gis_payload)
        response = requests.request("POST", url=url, data=gis_payload)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I print the gis_Payload variable it looks good to me...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;{'token': 'LRbp-wYEmcO_OFXps89bFEt3HZX34KhpqEAIWJeZE7rgxULrvuAFsSp-cqpkaB74K5ccaDNzjlXuYYCn33cyknr1Vo6', 'f': 'json', 'where': '1=1'}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kapalczynski_0-1705677654919.png" style="width: 553px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92198i7BF38028858FDDCD/image-dimensions/553x105?v=v2" width="553" height="105" role="button" title="kapalczynski_0-1705677654919.png" alt="kapalczynski_0-1705677654919.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 15:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372266#M69692</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2024-01-19T15:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Python Payload  WHERE clause syntax error</title>
      <link>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372366#M69693</link>
      <description>&lt;P&gt;Is there any reason to use an f-string here? Does this work?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;whereclause='1=1'
gis_payload = {
    'token': portaltoken,
    'f': 'json',
    'where': whereclause
}
print(gis_payload)
response = requests.request("POST", url=url, data=gis_payload)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Jan 2024 17:15:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372366#M69693</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2024-01-19T17:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python Payload  WHERE clause syntax error</title>
      <link>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372378#M69695</link>
      <description>&lt;P&gt;I will check... I converted to this before I saw your responce&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;whereclause="{}".format("1=1")
gis_payload = {
'token': portaltoken,
'f': 'json',
'where': whereclause
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Jan 2024 17:34:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-payload-where-clause-syntax-error/m-p/1372378#M69695</guid>
      <dc:creator>kapalczynski</dc:creator>
      <dc:date>2024-01-19T17:34:34Z</dc:date>
    </item>
  </channel>
</rss>

