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: converting LONG to VARCHAR

Re: converting LONG to VARCHAR

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 29 Sep 1999 11:02:40 -0400
Message-ID: <2ynyNw1umFy3Iy41i2lSxIBheZNf@4ax.com>


A copy of this was sent to "Steve Golamco" <sgolamco_at_sirius.com> (if that email address didn't require changing) On Mon, 27 Sep 1999 22:17:30 -0700, you wrote:

>
>I would like to do an update table statement to SET columnA = columnB.
>ColumnA is VARCHAR and columnB is LONG. Is there function I can use for
>this? I am using Oracle8 on Solaris 7.
>
>TIA,
>Steve
>
>
>
>
>

No, but you can do this:

begin
  for x in ( select rowid rid, LONG_COLUMN from T ) loop

      update T set varchar_column = x.long_column where rowid = x.rid;   end loop;
end;
/

if the long_columns are all 4000 bytes or less.

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Wed Sep 29 1999 - 10:02:40 CDT

Original text of this message

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