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?
Thx so much everyone that replied...I have plenty of ways to solve my column
probs now...have a good one!
-- Check out my site! (Still under construction!) http://members.home.net/rballard34/ Sign the guestbook if you like! -Rah "Robert Boyle" <rboyle_at_cyantel.com> wrote in message news:8729a6fe.0110150109.5d4ea5b5_at_posting.google.com...Received on Mon Oct 15 2001 - 04:14:40 CDT
> 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.