Sql 在 python 代码中更新查询
Sql update query in python code
我已经写了下面的代码,但它不起作用
它告诉 ORA-01008:并非所有变量都绑定。
cur.execute("update python set id = :10 where id = :1")
当Oracle解释器看到冒号时,它希望使用绑定变量,这将单独提供。
在您的情况下,您应该删除冒号:
update python set id = 10 where id = 1
我已经写了下面的代码,但它不起作用 它告诉 ORA-01008:并非所有变量都绑定。 cur.execute("update python set id = :10 where id = :1")
当Oracle解释器看到冒号时,它希望使用绑定变量,这将单独提供。
在您的情况下,您应该删除冒号:
update python set id = 10 where id = 1