这是我的代码,但我得到一个错误,说args没有定义。 我想知道如何从数据库和GUI中的用户访问数据。你知道吗
def f6():
upst.deiconify()
root.withdraw()
import cx_Oracle
con=None
cursor=None
try:
con=cx_Oracle.connect("system/abc123")
cursor=con.cursor()
sql="update student set name='%s' where rno='%d'"
args(name,rno)
cursor.execute(sql % args)
con.commit()
msg=str(cursor.rowcount)+"row updated"
messagebox.showinfo("Record updated",msg)
except cx_Oracle.DatabaseError as e:
if con is not None:
con.rollback()
messagebox.showerror("Failure",e)
finally:
cursor.close()
if con is not None:
con.close()
btnUpdate=Button(root,text="Update",width=10,command=f6)
目前没有回答
相关问题 更多 >
编程相关推荐