猿问

查询需要无限时间

这是我的代码,查询进入无限循环,没有任何错误或异常


import cx_Oracle

ip=''

port=''

sid=''

dns_tns=cx_Oracle.makedsn(ip,port,sid)

con = cx_Oracle.connect('username','password',str(dns_tns))

cursor = con.cursor()

print("start")

B={'APP_NAME': 'Hello', 'ISSUE_NAME': 'SP_164', 'ISSUE_TYPE': 'CR', 'DEVELOPER': 'username','TESTER': '','RELEASE_NO': '4.0', 'EST_DATE': '2018-10-10', 'ACT_DATE': '2018-10-10',\

  'DETECTED_PHASE': '',  'ISSUE_TRACKING_TOOL': 'SHAREPOINT','ID': 11}

sql_update = "UPDATE ISSUE SET ISSUE_TRACKING_TOOL = :ISSUE_TRACKING_TOOL,APP_NAME = :APP_NAME,\

RELEASE_NO = :RELEASE_NO,ISSUE_TYPE = :ISSUE_TYPE,DEVELOPER = :DEVELOPER,TESTER = :TESTER,\

ISSUE_NAME = :ISSUE_NAME,DETECTED_PHASE = :DETECTED_PHASE ,EST_DATE = TO_DATE(:EST_DATE, 'YYYY/MM/DD') \

,ACT_DATE = TO_DATE(:ACT_DATE, 'YYYY/MM/DD') WHERE ID = :ID"

cursor.execute(sql_update,B)

print("done")

con.commit()

con.close()


慕勒3428872
浏览 117回答 1
1回答

慕娘9325324

您可能会遇到另一个会话发生锁定的结果。您可以检查 dba_locks 视图以查看您的会话是否被另一个会话阻止,以及它是哪个会话。
随时随地看视频慕课网APP

相关分类

Python
我要回答