In this tutorial we are going to learn how to modify the data type of a column . If we want to Modify the datatype of a column , we have to use MODIFY with ALTER keyword . See the syntax below.

Syntax Oracle:

ALTER TABLE table_name
MODIFY column_name datatype(size)

Example :

MODIFY student_mob_no number(15)

Before changing the column datatype , make sure the column is empty (no data in column). If there is data in that column, we will get following error .

“column to be modified must be empty to change datatype”