cursor.execute(query)
在Django中未执行,如果我已使用sqldeveloper在oracle中输入了元组手册。
with connection.cursor() as cursor:
try:
print(value)
print(username)
cursor.execute("Select * from users where id=1")
finally:
cursor.close()
答案 0 :(得分:0)
使用下面的代码。
from django.db import connection
cursor = connection.cursor()
cursor.execute("SELECT * Table ")
results = cursor.fetchall()
答案 1 :(得分:0)
我认为您遇到了以下错误:AttributeError: __enter__
。
这个错误意味着您不能将语句with .. as ..
与conn.cursor()