Good evening.
I'm trying to put a pivot with the function
class db():
def __init__(self,coluna):
self.coluna = coluna
def inserir_coluna_tabela1(self):
import sqlite3 as sql
conn = sql.connect('db/dbase.db')
cursor = conn.cursor()
cursor.execute("""
ALTER TABLE 'tabela01'
ADD COLUMN ? 'TEXT NOT NULL'
""", self.coluna)
conn.commit()
#
print('Novo campo adicionado com sucesso.')
#
conn.close()
camponovo = db('2018')
camponovo.inserir_coluna_tabela1()
and is returning the error: sqlite3.OperationalError: near "?": syntax error
Thank you!