Home » SQL & PL/SQL » SQL & PL/SQL » alter table col
alter table col [message #9358] Wed, 05 November 2003 22:37 Go to next message
lok
Messages: 4
Registered: November 2003
Junior Member
i have a table
Name Null? Type
------------------------------- -------- ----
STATION NOT NULL VARCHAR2(20)
TWO_L VARCHAR2(2)
THREE_L NOT NULL VARCHAR2(2)
i want to alter the col Three_l not null varcha2(3),

please advice me

thanks
Re: alter table col [message #9359 is a reply to message #9358] Thu, 06 November 2003 00:02 Go to previous messageGo to next message
Rajarshi Dasgupta
Messages: 52
Registered: October 2001
Member
execute the following command at SQL prompt...

Alter Table

Modify THREE_L NOT NULL VARCHAR2(3));
Re: alter table col [message #9362 is a reply to message #9358] Thu, 06 November 2003 00:59 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Some additional info. The command by Rajarshi is correct but beware of the following.

Make sure that the column does not contain NULLs, or you'll hit the ORA-02296 (Null values found).
If you insist the constraint to be created you can add the NOVALIDATE keyword. This will enable the constraint without validation.

The length of a column cannot be decreased if the column contains values: It must be set to NULL in all records before you can decrease the length. Increasing is no problem.

MHE
Re: alter table col [message #9364 is a reply to message #9358] Thu, 06 November 2003 01:11 Go to previous messageGo to next message
lok
Messages: 4
Registered: November 2003
Junior Member
THANKS BOTH OF YOU FOR SUGGESTING TO SOLVE MY PROB.

I WILL KEEP IN TOUCH WITH U.

THANKS ONCE AGAIN
Re: alter table col [message #9447 is a reply to message #9358] Tue, 11 November 2003 02:59 Go to previous message
Sujit Sarkar
Messages: 40
Registered: September 2003
Member
alter table emp
modify column_name default null;
Previous Topic: ora 12571
Next Topic: query
Goto Forum:
  


Current Time: Thu Apr 25 06:55:19 CDT 2024