我試圖獲取從其DATA_TYPE = NUMBER(1,0)的柱用這段代碼一些數據:奇怪Oracle錯誤:「無效格式文本」
import cx_Oracle
conn = cx_Oracle.connect(usr, pwd, url)
cursor = conn.cursor()
cursor.execute("SELECT DELETED FROM SERVICEORDER WHERE ORDERID='TEST'")
print(cursor.fetchone()[0])
其抱怨這樣的:
Traceback (most recent call last):
File "main.py", line 247, in <module>
check = completed()
File "main.py", line 57, in completed
deleted = cursor.fetchone()[0]
cx_Oracle.DatabaseError: OCI-22061: invalid format text [T
將'DELETED'列替換爲其DATA_TYPE = VARCHAR2的列不會引發此類投訴。