Answers for "how to check if a column exists before alter the table"

0

how to check if a column exists before alter the table

conn = sqlite3.connect(':memory:')
c = conn.cursor()
try:
    c.execute('ALTER TABLE mytable ADD COLUMN newcolumn;')
except:
    pass # handle the error
c.close()
Posted by: Guest on August-18-2021

Code answers related to "how to check if a column exists before alter the table"

Python Answers by Framework

Browse Popular Code Answers by Language