美文网首页
pymysql 写入null

pymysql 写入null

作者: frankie_cheung | 来源:发表于2019-04-02 17:07 被阅读0次
    a='NULL'
    
    def updata():
        conn = pymysql.connect(host=host, port=port, user=user, passwd=password, db=db)
        cursor = conn.cursor()
        sql="insert into T_SENSOR_TRANSDUCER_ABBR(ABBR_CODE,VAR_TYPE_ID,VAR_TYPE_TRANSDUCER_LIST,QUALITYCONTROL_VERSION) VALUES('{}',{},'{}',{})".format("test",1,"test1",a)
        print(sql)
        cursor.execute(sql)
        conn.commit()
        print("haha")
    updata()```

    相关文章

      网友评论

          本文标题:pymysql 写入null

          本文链接:https://www.haomeiwen.com/subject/dcogbqtx.html