0

Iam trying to change the datatype of the column from integer(9) to Numeric(14,3). but not able to change

i tried below query

alter table TableName alter ColumnName NUMERIC (14,3);
Boneist
  • 22,910
  • 1
  • 25
  • 40
Rohit Pal
  • 27
  • 8
  • 1
    possible duplicate of [How to alter a column datatype for derby database?](http://stackoverflow.com/questions/2385020/how-to-alter-a-column-datatype-for-derby-database) – Darkwing Jul 20 '15 at 13:26
  • What error are you getting? – Boneist Jul 20 '15 at 13:27
  • @Andrej : that is for decimal to decimal, which is not useful to me. – Rohit Pal Jul 20 '15 at 13:31
  • @Boneist iam getting syntax error: Encountered "Numeric" at line 1,Column 50 – Rohit Pal Jul 20 '15 at 13:32
  • 1
    Rohit, that question describes the way to alter the datatype - looks like you'll only be able to do it by creating a new column, copying the data over, dropping the old column and then renaming the new column. – Boneist Jul 20 '15 at 14:07

1 Answers1

0

hope below one will help.

ALTER TABLE Table_Name ALTER COLUMN Column_Name SET DATA TYPE NUMERIC(14,3);

Ramesh
  • 340
  • 1
  • 7
  • 21
  • Helped me to change the size of the column. but when trying to change the type, again getting syntax error like numeric is not possible type to change. can you help me on this – Rohit Pal Jul 22 '15 at 08:57