0
ALTER TABLE Product ALTER COLUMN weight decimal (5,2);

I tried using (2,1) and MySQL was unable to store the value 12.0 and gave the error message that the entered value was out of the range of weight so I tried increasing its range with the above mentioned query and it is showing a problem with decimal (5,2) part.

Filburt
  • 17,626
  • 12
  • 64
  • 115
  • I'm assuming that replacing `ALTER COLUMN` with `MODIFY COLUMN` should fix the issue, because that's how the mysql dialect expects the alter table statement to work. – Vogel612 Nov 19 '21 at 11:34
  • please check this https://stackoverflow.com/questions/19773164/mysql-how-do-i-update-the-decimal-column-to-allow-more-digits – Franco Berardi Nov 19 '21 at 11:36
  • you're a saviour, I was going crazy over this silly thing. Thanks a lot. – Prafull Jauhri Nov 19 '21 at 11:38

0 Answers0