python代码
'''
Author: liukai 2810248865@qq.com
Date: 2022-08-18 04:28:52
LastEditors: liukai 2810248865@qq.com
LastEditTime: 2023-07-06 22:12:56
FilePath: \PythonProject02\pandas以简化excel的编写和数据操作.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
'''
import cx_Oracle
import pandas as pdcon = cx_Oracle.connect('c##rootuser/1qaz@0987654321 @192.168.56.115:1521/ORCLCDB')
data = pd.read_sql('SELECT ID, C1, C2, C3 FROM "C##ROOTUSER".INSERTTEST3', con)
#data.head() # take a peek at data
data.to_excel('my_oracle_table.xlsx')
con.close()