Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to change data type of a column after the table is created

Sriram_91Aug 14 2015 — edited Aug 14 2015

This is my table desc

SQL> desc job1

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

JOB_CODE                                  NOT NULL VARCHAR2(3)

JOB_CLASS                                          VARCHAR2(30)

CHG_HOUR                                           NUMBER(5,2)

OVERTIMECHARGE                            NOT NULL NUMBER

I want to change the CHG_HOUR column to store numbers up to 12 digits in length (including decimal points).

I tried the following and it didnt help

SQL> alter table job1 alter column chg_hour number (6,6);

alter table job1 alter column chg_hour number (6,6)

                 *

ERROR at line 1:

ORA-01735: invalid ALTER TABLE option

SQL> alter table job1 modify chg_hour number(6,6);

alter table job1 modify chg_hour number(6,6)

*

ERROR at line 1:

ORA-01438: value larger than specified precision allowed for this column

where am i going wrong ?

This post has been answered by Jarkko Turpeinen on Aug 14 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2015
Added on Aug 14 2015
10 comments
7,366 views