cnxn = pyobdc.connect(...)
cursor = cnxn.cursor()
sql = 'create table if not exists tab1 (id integer primary key, entry varchar (200), exit varchar (200))'
cursor.execute(sql)
cnxn.commit()
in the above code, the query "sql" has the keyword "exit" as a column name which throws up an error. I therefore made the change of enclosing the keyword in quotes like
sql = 'create table if not exists tab1 (id integer primary key, entry varchar (200), "exit" varchar (200))'
and even tried
sql = 'create table if not exists tab1 (id integer primary key, entry varchar (200), `exit` varchar (200))'
Which still gives me the error:
ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL Serveer Driver][SQLServer]Incorrect syntax near '"'. (102) (SQLExecDirectW)")
or accordingly,
ProgrammingError: ('42000', "[42000] [Microsoft][ODBC SQL Serveer Driver][SQLServer]Incorrect syntax near '`'. (102) (SQLExecDirectW)")
Please help me understand how to overcome this problem without having to change the column name, thanks!