Python SQL/JSON输入“ON”不匹配,应为“EOF”

2024-09-30 00:34:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用一个可以通过JSON发送sql查询的SDK,但是我得到了一个错误:

  File "/usr/lib/python2.7/site-packages/requests/models.py", line 893, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: mismatched input 'ON' expecting 'EOF' for url: https://solarwinds-orion:17778/SolarWinds/InformationService/v3/Json/Query

这是我使用的代码:

^{pr2}$

这是到模式的链接

自定义属性-http://solarwinds.github.io/OrionSDK/schema/Orion.NodesCustomProperties.html 节点-http://solarwinds.github.io/OrionSDK/schema/Orion.Nodes.html

从我在内部连接上搜索的结果来看,查询应该没问题吧?在


Tags: iogithubjsonhttpforsqlschemahtml
1条回答
网友
1楼 · 发布于 2024-09-30 00:34:16

将表别名从ON更改为其他名称,您应该可以:

SELECT NodeID        You should also be using the appropriate table alias
      ,NodeName      for each of these columns.
      ,IPAddress
      ,IP
      ,IP_Address
      ,NodeIPAddresses 
FROM Orion.Nodes N
    inner join Orion.NodesCustomProperties CP
        on N.NodeID = CP.NodeID
WHERE CP.smartnet = 1

这是一个错误,因为on是一个保留关键字,如select或{},它对sql编译器有重要意义。在

相关问题 更多 >

    热门问题