I am trying to redefine the number of varchars a column can have (in a MySQL db).
I am doing
alter table obj_details IMG_SRC IMG_SRC varchar(180);
I want to change the number of characters that can be used in the column IMG_SRC to 180 (it is currently 100). But I get an error saying that I should check the syntax near IMG_SRC IMG_SRC varchar(180).
Why did you write IMG_SRC
twice? You want:
ALTER TABLE obj_details MODIFY IMG_SRC varchar(180);
(For what it's worth the COLUMN
in MODIFY COLUMN
is optional, see here.)