Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python DatabaseError:ORA-00900:无效的SQL语句_Python_Oracle - Fatal编程技术网

Python DatabaseError:ORA-00900:无效的SQL语句

Python DatabaseError:ORA-00900:无效的SQL语句,python,oracle,Python,Oracle,请帮助新的编码 我总是出错 在getSidsWithStatusX中 sip.execute(query)数据库错误:ORA-00900:无效的SQL语句 我通过: GET_STARTDATE_QUERY = """ select sid from contact_requests where entry_date > '{startDate:'%

请帮助新的编码

我总是出错

在getSidsWithStatusX中 sip.execute(query)数据库错误:ORA-00900:无效的SQL语句

我通过:

GET_STARTDATE_QUERY = """
                        select sid
                        from contact_requests
                        where entry_date > '{startDate:'%d-%b-%Y'}'
                    """


GET_ENDDATE_QUERY = """
                    and entry_date < '{endDate:'%d-%b-%Y'}'
                """


GET_STATUSID_QUERY = """
                           and request_status_id = '{statusX:s}'
                       """
GET\u STARTDATE\u QUERY=”“”
选择sid
从联系人请求
其中条目_date>'{startDate:'%d-%b-%Y'}'
"""
GET_ENDDATE_QUERY=“”
和输入日期<'{endDate:'%d-%b-%Y'}'
"""
获取\u STATUSID\u QUERY=“”
和请求_status_id='{statusX:s}'
"""

格式字符串中的格式规范周围不应该有引号。这些引号将被复制到结果中,因此您将得到两组引号,一组来自
{
之前的引号和
}
之后的引号,另一组来自
%d-%b-%Y
周围的引号

GET_STARTDATE_QUERY = """
                        select sid
                        from contact_requests
                        where entry_date > '{startDate:%d-%b-%Y}'
                    """

正在执行的查询是什么。把它添加到问题中。典型的调试场景。如果看不到实际的sql查询本身,就无法提供帮助。“logger.debug(query)”打印到日志中的内容是什么?@AydinK。这是它在getSidsWithStatusX sip中打印的错误。执行(查询)数据库错误:ORA-00900:无效SQL语句
GET_STARTDATE_QUERY = """
                        select sid
                        from contact_requests
                        where entry_date > '{startDate:%d-%b-%Y}'
                    """