There is a code which inserted record In a DB
def insertMult(connect,array): connect.execute("INSERT INTO Goods (Gtin,Length,Width,Height,Weight,Multuplicator,Gtin2) \ VALUES ("+array[0]+","+array[1]+","+array[2]+","+array[3]+","+ array[4]+","+array[6]+","+array[7]+")"); connect.commit() Everything was ok, now there is a need for Id auto - increment
Added field to DB with Id. I run the code and get the exit ..
NOT NULL constraint failed: Goods.Id Changed the code to
def insertMult(connect,array): connect.execute("INSERT INTO Goods (Id,Gtin,Length,Width,Height,Weight,Multuplicator,Gtin2) \ VALUES ("+array[0]+","+array[1]+","+array[2]+","+array[3]+","+ array[4]+","+array[6]+","+array[7]+")"); connect.commit() Now insert 7 values in 8 columns of the table, since Id auto increment do not pass anything and the same error .. I also transmitted 8 values .. the same error .. Help plz