Java DB (Derby) Database Alter Column Size

Josh Pritchard picture Josh Pritchard · Sep 28, 2013 · Viewed 9k times · Source

I'm trying to alter the size of a field in my Java DB Database. I just can't seem to do it. My current data type is varchar(50) and I want to update it to varchar(150).

Answer

Josh Pritchard picture Josh Pritchard · Oct 4, 2013

Solved:

ALTER TABLE [table] ALTER COLUMN [column] SET DATA TYPE [type];

I wasn't using the SET DATA TYPE function and was instead just trying to redeclare it by using ALTER COLUMN [column] [type];