있는데요. 5건의 데이터를 하나로 합쳐서 보내는데 이게 처음 몇번은 잘 되는데 여러번 반복하다보니까 리스트 범위 초과 오류가 나오더라구요
Traceback (most recent call last): File "D:\Eclipse workspace\maketempdata\outlet\transoutlet_val_samsung.py", line 111, in <module> del result[6] IndexError: list assignment index out of range
selectquery = "SELECT * FROM samsung WHERE gatecode = %(gatecode)s AND plccode = %(plccode)s AND relaynum = %(relaynum)s" insertquery = "INSERT INTO samsung (gatecode, plccode, relaynum, date, amp, state, power) VALUES(%(gatecode)s, %(plccode)s, %(relaynum)s, %(date)s, %(amp)s, %(state)s, %(power)s)" searchquery = "SELECT count(*) FROM samsung WHERE gatecode = %(gatecode)s AND plccode = %(plccode)s AND relaynum = %(relaynum)s"
item_count = 0 for gaco in gate: for plccode in plc: for relay in relayn: factor={ "gatecode": gaco, "plccode": plccode, "relaynum": relay, } with fromdb.cursor() as cur: cur.execute(searchquery,factor) searchtemp = cur.fetchone() item_count = searchtemp[0] cur.execute(selectquery,factor) temp = cur.fetchmany(minute)