I need to add columns to a database and every second column does not have a name, i wanted to give it a generic "x" name but i get the sqlite3.OperationalError: duplicate column name: x error,
for meci in ech1:
c.execute("ALTER TABLE Aranjate ADD COLUMN "+ ech1[ii] +" INT")
c.execute("ALTER TABLE Aranjate ADD COLUMN x INT")
c.execute("ALTER TABLE Aranjate ADD COLUMN "+ ech2[ii] +" INT")
conn.commit()
ii = ii +1
and i tried to replace x with x = str(ii) so it will not have the same name and insert it as variable:
c.execute("ALTER TABLE Aranjate ADD COLUMN " + x + " INT")
but i suppose that sqlite does not accept integers as table names as i get the error sqlite3.OperationalError: near "0": syntax error where 0 is the first x
It will not be a problem for me if those columns are named the same as all i will do with this table is export it as a csv file