Insert data into CiqHistorical master table in Mysql
sql ="""INSERT INTO CiqHistorical(CiqRefID, CoID, GVKEY, IID, GRID, CreateDID, SectorID, UserID, ClientID, MinPeriodID, MaxPeriodID, MaxPeriodDID, MinAnnualID, MaxAnnualID, MaxAnnualDID) VALUES(%s,%s,'%s','%s',%s,GetDateID(now()),%s,%s,%s,%s,%s, GetDateID('%s'),%s,%s,GetDateID('%s'));""" %(ciq_ref_id, coid, gvkey, iid, grid, sector_id,user_id, client_id, min_period_id, max_period_id, max_period_did, min_annual_id, max_annual_id, max_annual_did) ciq_hist = self.mysql_hermes.execute(sql)