提交后更新psycopg2不工作

时间:2016-09-21 09:34:11

标签: python psycopg2

我有这段代码......

def updateValuestoFileModule():  
    listData()  
    fileName= input("Enter name File Name for which you need to update modules to existing record   :")  
    Modulename=[x for x in input("ENTER THE Module Names seperated by space :").split()]  
    print (type(Modulename))  
    print (Modulename)  
    cur.execute("SELECT File_Name,Module_Name from TC2Mod")  
    allrow=cur.fetchall()  
    for onerow in allrow:  
        if onerow[0]==fileName:  
            newModules=[]  
            rembraces= onerow[1].replace('{', '').replace('}', '')  
            listOneRow=rembraces.split(',')  
            print (type(listOneRow))  
            print (listOneRow)  
            newModules=listOneRow+Modulename  
            print (newModules)  
            cur.execute("UPDATE TC2Mod SET Module_Name =(%s) WHERE File_Name = (%s);",(newModules,fileName))  
            conn.commit  

但是虽然我提交了更新,但是没有发生更新。 任何帮助请...

0 个答案:

没有答案