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: Copying Long columns

Re: Copying Long columns

From: Lothar Armbrüster <lothar.armbruester_at_rheingau.netsurf.de>
Date: 1998/05/12
Message-ID: <1010.436T1200T12253983@rheingau.netsurf.de>#1/1

On 11-Mai-98 16:42:37 Sabarinath Nair wrote:

>Hi,
 

>In our application, I need to copy some rows from one table to the same
>table (basically an insert from select). This does not work on tables
>which have a long or long raw column. Is there a way to acheive this.

Hello Sabari,
you could do this in PL/SQL:

declare

cursor tab_cur is

   select * from your_tab
   where <your where clause>

begin

   for tab_rec in tab_cur loop

      insert into your_tab
         (your fields)
      values
         (your fields prefixed with tab_cur.);
   end loop;
end;
/

Unfortunately you will have to list all fields to be inserted there is no constrct like

insert into your_table values(tab_rec);

i.e. you cannot insert a whole record, just single fields. (This is true for Oracle 7.3. I don't know if there is a solution in Oracle 8.)

Hope that helps,
Lothar

--
Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Schulstr. 12            | lothar.armbruester_at_t-online.de
D-65375 Oestrich-Winkel |
Received on Tue May 12 1998 - 00:00:00 CDT

Original text of this message

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