pypyodbc execute returns list index out of range error
问题 I have a function that runs 3 queries and returns the result of the last (using the previous ones to create the last) when I get to the 3rd query, it get a list index our of range error. I have ran this exact query as the first query (with manually entered variables) and it worked fine. This is my code: import pypyodbc def sql_conn(): conn = pypyodbc.connect(r'Driver={SQL Server};' r'Server=HPSQL31\ni1;' r'Database=tq_hp_prod;' r'Trusted_Connection=yes;') cursor = conn.cursor() return conn,