How to solve 07002 too few parameters

  pyodbc, python, sql

I have the following code:

        self.cursor.execute("""UPDATE Names SET Format = ?, FoodServiceBulkPack = ?, EachUPC = ?,
        EachWeight = ?, EachUOM = ?, QtyPerInner = ?, InnerPackUPC = ?, InnerWeight = ?,
        InnerUOM = ?, QtyPerCase = ?, CaseUPC = ?, CaseWeight = ?, CaseUOM = ?,
        QtyCasesperPallet = ?, CaseGTIN = ?, [Short Description] = ?, [Long Description] = ?,
        FrontImage = ?, RearImage = ?, Layflat = ?, Perishable = ?,
        IsMultiPack = ?, IsVarietyPack = ?, IsDisplayShipper = ?, PalletUPC = ?, PalletWeight = ?, PalletUOM = ?,
        PalletTi = ?, PalletHi =  = ?
        WHERE ((BrandName = """ + brandName + 
        ") AND ([ProductStyle /Category] = " + productStyle + 
        ") AND (ProductFlavor = " + productFlavor + ")) """, conv_list)
        self.con.commit()

I made sure number of elements in conv_list is the same as question marks. However, I get the following problem

    self.cursor.execute("""UPDATE Names SET Format = ?, FoodServiceBulkPack = ?, EachUPC = ?,   
    pyodbc.Error: ('07002', '[07002] [Microsoft][ODBC Microsoft Access Driver] Too few parameters. 
    Expected 64. (-3010) (SQLExecDirectW)')          

Source: Python Questions

LEAVE A COMMENT