Reputation: 209
I regularly take caution when creating tables for database. This time I came across a situation to alter a table.
I wanted to change the Data Type of a field/column in Table.
To change the data type of a column in a table: General Syntax
ALTER TABLE table_name ALTER COLUMN column_name datatype
SQL Query :
alter table employee modify column ename varchar(40);
I Rarely use Alter and Modify commands. This time when tried, it throws me an Error as ORA-00905: missing keyword
.
I surfed the Internet and referred StackOverflow raised questions, but there is no relative answer found.
I also referred this Oracle Documentation : Oracle Reference Documentation
But It did not help.
Upvotes: 1
Views: 14546
Reputation: 21
Try This: ALTER TABLE Shopper MODIFY MobileNo(varchar2(15))
Upvotes: 0