def createdb(dbName,tbName,sql): rowcount=0 db = Oracledbx.DealOracle(login) db.connectdb() cusor = db.newcur() try: sql0="select * from all_all_tables where owner=upper('"+dbName+"') and table_name=upper('"+tbName+"')" find_result=finddb(sql0) if find_result==0: result = db.exec_sql(sql, cusor) print("create info:table create successful!") else: print("create info:table is exist!") except: traceback.print_exc() db.closecur(cusor) db.closedb() def createdb2(sql): rowcount=0 db = Oracledbx.DealOracle(login) db.connectdb() cusor = db.newcur() try: db.exec_sql(sql, cusor) except: traceback.print_exc() db.closecur(cusor) db.closedb() def demo(): creSql = "DROP TABLE ODSPMART.T_MID_JT_INTERFACE_UP
Python 中写多条SQL语句的写法
最新推荐文章于 2022-01-26 20:21:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)