Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to shorten a column's length that already HAS data in it?
Sounds to me like you are using a CHAR field type. I would do two
things (based on the fact that your original field is CHAR(50):
ALTER TABLE mytable
MODIFY myfield VARCHAR2(50)
/
UPDATE TABLE mytable
SET myfield = TRIM(myfield)
/
COMMIT
/
ORACLE will pad your field with spaces if you have a CHAR field as the field is a fixed length. A VARCHAR2 field is of variable length and so is not padded. Should really use these whenever possible.
HTH
R.
Received on Mon Oct 15 2001 - 04:09:35 CDT
![]() |
![]() |