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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to copy LONG column

Re: How to copy LONG column

From: Ari Kaplan <akaplan_at_psycfrnd.interaccess.com>
Date: 1997/05/21
Message-ID: <5lv859$aa8@psycfrnd.interaccess.com>#1/1

Tom Wilson <tdwilson_at_mindspring.com> writes:
>I need to copy a long varchar from one table to another using
>UPDATE tab1 SET longcol = (SELECT longcol2 FROM tab2 WHERE
>tab1.key=tab2.key);
>But I get an error that this is an invalid use of a LONG column. How do
>I insert or update a long column by copying a value from another column?
>Tom

The only way I have been able to do this is to use PL/SQL. Define a variable as LONG and open a cursor into the variable. From here you can manipulate the variable in ways you cannot with straight SQL. Things such as substr, rtrim, instr, length, etc.

I hear Oracle8 will be able to handle LONG manipulations in SQL.

-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 60+ technical tips, visit my Web Page:                    <->
<->                                                               <->
<->              http://homepage.interaccess.com/~akaplan         <->
<->                                                               <->
<->             email: akaplan_at_interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Received on Wed May 21 1997 - 00:00:00 CDT

Original text of this message

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