Nandesh
Nandesh

Reputation: 4633

Error while changing/altering column name in MySql?

I am trying to change column Customer_email to customerEmail but it gives error

The code which is giving error is

alter table getCustomer
change Customer_email customerEmail varchar;

The code is working fine with "int" type columns.

Changing Column name error

Upvotes: 0

Views: 164

Answers (1)

mrks
mrks

Reputation: 8343

For the type VARCHAR, you have to give the maximum length of the string, e.g., VARCHAR(50).

Upvotes: 1

Related Questions