I have a table which has data which looks like below
Name Query RunDate
SP Some_sp 12/25/2017
Sp1 Some1_sp 12/25/2017
sp_2 Some2_sp 12/25/2107
Query column has the stored procedure to be executed.
def __init__(self):
self.conn=pypyodbc.connect(connection)
self.cursor=self.conn.cursor()
def getDatafromDB(self):
sql = """Select * from table"""
self.cursor.execute(sql)
data=pd.DataFrame(self.cursor.fetchall())
return data
I am querying that table and saving it as a pandas dateframe . Next step is for me to execute those stored procedure present in query column one after the other. Is there a way to do this using pypyodbc ?