Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to shorten a column's length that already HAS data in it?

Re: How to shorten a column's length that already HAS data in it?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 15 Oct 2001 05:32:06 +0200
Message-ID: <tsm3ut8as85ofa@corp.supernews.com>

"Raheen Ballard" <rballard34_at_home.com> wrote in message news:Yopy7.129914$5A3.40917767_at_news1.rdc2.pa.home.com...
> Hi!
> 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?
>
> Thx so much in advance!
>
>
>
> --
> Check out my site! (Still under construction!)
> http://members.home.net/rballard34/
> Sign the guestbook if you like!
>
> -Rah
>
>

Create table with
the primary key of the source table
the affected column
now insert into <temp_table> select pk, affected column from source now update source set affected_column = NULL alter table
update source table s
set affected_column = (select affected column from temp_table x where x.pk = s.pk)

Hth,

Sybrand Bakker
Senior Oracle DBA Received on Sun Oct 14 2001 - 22:32:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US