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?
> I have some columns that have a lot of padding after the last letter
of
> the entries. I tried to alter
> them using the "alter table" command, but it tells me they have to be
empty
> in order for this to work.
> I tried to copy the column to a view, shorten the original column length,
> but when I try to put them back, of
> course I'd get the error that the data is "too long" for the column
because
> of the padding....any suggestions
> other than manually re-entering the data?
Create a new and shorter column.
Copy all values from the old to the new column with
update table xyz
set new_column = lpad(old_column, options)
drop old column
Hope that works.
So long,
Jan Received on Mon Oct 15 2001 - 03:53:02 CDT
![]() |
![]() |