Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我现在正在使用 cx-oralce,我必须执行一条 sql 语句。对于 R,sendquery 和 getinfo 用于它并检查执行是否完成。我可以用 cx-oralce 在 Python 中做类似的事情吗?我需要能够查看执行是否完成!
rs = ROracle::dbSendQuery(conn, sql) if (!ROracle::dbGetInfo(rs)$completed) { msg <- "Failed "
使用 cx_Oracle,您可以执行以下操作:
try: conn.execute(sql) except cx_Oracle.DatabaseError as e: print("Failed:", e)