Question on Constraints

I am new to Oracle. I have created one table in that one column name salary, while creating the table I have given the datatype for that column is varchar2 and also I have given not null constraint. Now I want to change the datatype varchar2 to number, Is it possible to alter the datatype when having constraint in table?

Showing Answers 1 - 6 of 6 Answers

Abhimanyu eati

  • Nov 17th, 2017
 

Yes we can change datatype but make sure about size if you have created varchar(5) then alter to number(5)

DevaNaidu

  • Mar 7th, 2018
 

If you want change only varchar2 to number you can change by using ALTER, but you also defined NOT NULL constraints..so if you need to change a datatype along with Not null..you must use MODIFY key word

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions