我试图从cvs文件中将数据填充到数据库中 . 我得到了这个1064错误,但我找不到bug的位置 .

回溯(最近一次调用最后一次):文件“code.py”,第252行,在fill_patient()文件“code.py”,第169行,在fill_patient中cur.execute(sql,data)文件“/ usr / lib / python2.6 / site-packages / MySQLdb / cursors.py“,第166行,执行self.errorhandler(self,exc,value)文件”/usr/lib/python2.6/site-packages/MySQLdb/connections.py “,第35行,在defaulterrorhandler中引发错误类,errorvalue _mysql_exceptions.ProgrammingError:(1064,”你的SQL语法有错误;请查看与你的MySQL服务器版本对应的手册,以便在''Y1_99341'附近使用正确的语法, 'case','Solo,Han','Tatooine St-Wookie Clinic',0,26,37,0)'在第1行“)

我的代码:

def fill_genotype():
        con = connect()
        cur = con.cursor()

        with open("./data/genotype.csv",'rU') as f:
            header = ['SAMPLE_ID','PATIENT_ID','LOCATION','AFTER_TREAT','CONCENT','VOLUME','RIN','DATE_COLLECT','FREEZER_ID','BOX_ID','X','Y']
            reader = csv.DictReader(f,fieldnames=header)
                reader.next()

            for row in reader:

                cur.execute("INSERT INTO INVESTIGATOR VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",(row['SAMPLE_ID'],row['PATIENT_ID'],row['LOCATION'],row['AFTER_TREAT'],row['CONCENT'],row['VOLUME'],row['RIN'],row['DATE_COLLECT'],row['FREEZER_ID'],row['BOX_ID'],row['X'],row['Y']))

        con.commit()
            con.close()