pavis
pavis

Reputation: 1

Pymysql query throwing error when I add column with type varchar(100)

I am new to using pymysql and SQL:

I have the following code which will run:

SQLquery = "CREATE TABLE sch_test4(id int, case_id varchar(40), procedure_date DATETIME, provider varchar(50));"
cursor.execute(SQLquery)

But when I add one more column, it will error:

SQLquery = "CREATE TABLE sch_test4(id int, case_id varchar(40), procedure_date DATETIME, procedure varchar(100), provider varchar(50));"
cursor.execute(SQLquery)

Why is adding procedure varchar(100) throwing an error?

Upvotes: 0

Views: 71

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269443

procedure is a SQL keyword used to create user-defined procedures.

I would suggest giving the column a different name, such as procedure_name.

Upvotes: 1

Related Questions