我如何在 python 中查看 oracle 數據庫中的表列表?現在我只是有連接:import cx_Oracledb_connection_string = 'username/passwort1@server:port/servername'con = cx_Oracle.connect(db_connection_string)print("Database version:", con.version)cur.execute("SELECT owner, table_name FROM dba_tables")con.close() 打印出版本:數據庫版本:12.2.0.1.0但是我怎樣才能看到該數據庫中可用的所有表的列表呢?就像是: Salesdata,Buyingdata我怎樣才能看到所有表的列表?
1 回答

MMMHUHU
TA貢獻1834條經驗 獲得超8個贊
如果您只想要表列表(沒有表所有者):
cur.execute("SELECT table_name FROM dba_tables")
for row in cur:
print row
添加回答
舉報
0/150
提交
取消