#-----ORACLE SECTION---------# import cx_Oracle from pptx import Presentation try: dsn_tns = cx_Oracle.makedsn('Host Name', 'Port Number', service_name='Service Name') conn = cx_Oracle.connect(user=r'User Name', password='Personal Password', dsn=dsn_tns) # Now execute the sqlquery cursor = conn.cursor() cursor.execute("insert into student values(19585, Niranjan Shukla, 72000") for row in cursor: print (row[0], '-', row[1]) # commit that insert the provided data # con.commit() prs = Presentation() title_slide_layout = prs.slide_layouts[0] slide = prs.slides.add_slide(title_slide_layout) title = slide.shapes.title subtitle = slide.placeholders[1] title.text = "Hello, World!" subtitle.text = "python-pptx was here!" prs.save('test.pptx') cursor.close() except cx_Oracle.DatabaseError as e: print("There is a problem with Oracle", e) # by writing finally if any error occurs # then also we can close the all database operation finally: if cursor: cursor.close() if conn: conn.close()