Guest User

Untitled

a guest
Jul 15th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. def __init__(self,coluna):
  2. self.coluna = coluna
  3.  
  4. def inserir_coluna_tabela1(self):
  5. import sqlite3 as sql
  6. conn = sql.connect('db/dbase.db')
  7.  
  8. cursor = conn.cursor()
  9.  
  10. cursor.execute("""
  11. ALTER TABLE 'tabela01'
  12. ADD COLUMN ? 'TEXT NOT NULL'
  13. """, self.coluna)
  14.  
  15. conn.commit()
  16. #
  17. print('Novo campo adicionado com sucesso.')
  18. #
  19. conn.close()
Add Comment
Please, Sign In to add comment