Re: Using cursors to insert records

From: KRM <malleykr_at_my-deja.com>
Date: Wed, 17 Nov 1999 18:33:06 GMT
Message-ID: <80usd2$77q$1_at_nnrp1.deja.com>


[Quoted] I'm not entirely sure what your message text is talking about, so I'm going to give answering your question a shot using the title to guide me. If I understand you correctly, you want to be able to insert a bunch of records, based on records in a cursor. The easiest way is to use a for loop. For instance, if you have defined a cursor named my_cursor, you could say......

  FOR MY_REC IN MY_CURSOR LOOP

     INSERT into MY_TABLE
       (row1,
        row2)
     VALUES
       (MY_REC.row1,
        MY_REC.row2);

  END LOOP; You don't have to define MY_REC anywhere, just use it. This will go thru each record in the cursor and insert it into the table.

Good luck!

In article <0f8c6c44.7d50eece_at_usw-ex0110-075.remarq.com>,   bungle <igoingNOigSPAM_at_mother.co.uk.invalid> wrote:
> I *cannot* believe that ORACLE won't accept the following :
>
> INSERT INTO TABLE_1 VALUES (v_table_1)
>
> where v_table_1 is TABLE_1%ROWTYPE....
>
> There *must* be a workaround (other than explicitly naming
> every column I want to insert into).
>
> Can anyone help?
>
> * Sent from AltaVista http://www.altavista.com Where you can also
find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Nov 17 1999 - 19:33:06 CET

Original text of this message