这里是写入mysql和oracle的两个例子
from sqlalchemy import create_engine
import pandas as pd
user=""
password=""
host=""
port=""
database=""
mysql_engine = create_engine(f"mysql+pymysql://{user}:{password}@{host}:{port}/{database}") #mysql
oracle_engine = create_engine(f"oracle+cx_oracle://{user}:{password}@{host}:{port}/{database}") #oracle
df=pd.DataFrame()
table=""
df.to_sql(name=table,con=mysql_engine.connect(),if_exists="append",index=False) #mysql
df.to_sql(name=table,con=oracle_engine.connect(),if_exists="append",index=False) #orcle
写入oracle时表要为小写,否则会报错