This is rather a very simple question to all--I just got back to Oracle after a long time. The question is how do I resize the columns in a given table? I need the syntax of the command, please.
This is a pretty easy one. The only catch is that you need to "modify" the existing columns. Let's assume that I'm going to resize the NAME column of the EMPLOYEE table to 50 characters. For that, I'll use the following command:
ALTER TABLE employee MODIFY (name VARCHAR2(50));
The only big caveat is that you cannot resize a column smaller than its longest element. For instance, if the NAME column contained a name that was 30 characters in length, then you cannot make the column 25 characters. You will receive an error.
For More Information
- What do you think about this answer? E-mail us at [email protected] with your feedback.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
- Ask the Experts yourself: Our Oracle guru is waiting to answer your toughest questions.