I am creating a data parameter to pass to my Rest Service to Delete a bunch of records.
This works great on my laptop via VPN into my work servers
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...
Again it runs fine from my computer but its not on the server....
whereclause='1=1'
gis_payload = {
'token': portaltoken,
'f': 'json',
'where': f'''{whereclause}'''
}
print(gis_payload)
response = requests.request("POST", url=url, data=gis_payload)
When I print the gis_Payload variable it looks good to me...
{'token': 'LRbp-wYEmcO_OFXps89bFEt3HZX34KhpqEAIWJeZE7rgxULrvuAFsSp-cqpkaB74K5ccaDNzjlXuYYCn33cyknr1Vo6', 'f': 'json', 'where': '1=1'}
Solved! Go to Solution.
Is there any reason to use an f-string here? Does this work?
whereclause='1=1'
gis_payload = {
'token': portaltoken,
'f': 'json',
'where': whereclause
}
print(gis_payload)
response = requests.request("POST", url=url, data=gis_payload)
Is there any reason to use an f-string here? Does this work?
whereclause='1=1'
gis_payload = {
'token': portaltoken,
'f': 'json',
'where': whereclause
}
print(gis_payload)
response = requests.request("POST", url=url, data=gis_payload)
I will check... I converted to this before I saw your responce
whereclause="{}".format("1=1")
gis_payload = {
'token': portaltoken,
'f': 'json',
'where': whereclause
}