Newsgroups: comp.databases.oracle.server
Subject: Re: How to copy LONG column
References: <33826895.2A40@mindspring.com>

Tom Wilson  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:                    <->
<->                                                               <->
<->              www.arikaplan.com                                <->
<->                                                               <->
<->             email: akaplan@interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->

Back to Ari Kaplan's Home Page Kaplan's Home Page