'How to insert excel data into oracle sql using python?

Hi I'm trying to load data from excel to oracle SQL table using Python. I'm able to load single record but don't know how to load from excel pandas dataframe. the excel file contains more than 6000records. Please find my below code. Kindly help to alter the code.

import cx_oracle 
import pandas as pd

try:    
   con = cx_oracle.connect(connection detials) except 
KeyError:   
   cx_oracle.init_oracle_client(lib_dir=path)

df=pd.read_excel(Path)
df.head()

cur = con.cursor() sqlTXT="TRUNCATE TABLE smax_eu_load.HIST_USER_UAT" 
cur.execute(sqlTXT)

sql="INSERT INTO HIST_USER_UAT(ID, FULLNAME, SSO) VALUES('aa','bb','cc')" 
cur.execute(sql) 
con.commit() 
cur.close() 
con.closse()


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source