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: Copying rows with LONG RAW field to another database

Re: Copying rows with LONG RAW field to another database

From: Doug Anderson <dathedba_at_mindspring.com>
Date: 1997/03/25
Message-ID: <5h9iko$rcl@camel4.mindspring.com>#1/1

cbohl_at_orag.ch (Christoph Bohl) wrote:
>I have to copy about 1,000,000 rows out of a table which contains about
>100,000,000 rows into another database.
>I tried the copy command ... not possible with long raw data
>I tried in PRO*C (i'm a beginner in c), it works but the data i get
>is not what it should be...

How about something like the following procedure in PL/SQL but change the reference to the original table to use a DB Link?


CREATE OR REPLACE PROCEDURE CopyBlobs (

          p_LowKey  IN NUMBER,
          p_HighKey IN NUMBER    ) AS

   v_BlobRecord blobowner.blob001%ROWTYPE;

   /* Cursor declaration */
   CURSOR c_Blob IS

      SELECT *
      FROM blobowner.blob001
      WHERE (key >= p_LowClaimKey)
        AND (key <= p_HighClaimKey);

BEGIN
   OPEN c_Blob;

   LOOP

      /*  Retrieve each row into a PL/SQL record.  */
      FETCH c_Blob INTO v_BlobRecord;

      EXIT WHEN c_Blob%NOTFOUND;

      /*  Put the row into the other table.  */
      INSERT INTO otherblob
         VALUES (v_BlobRecord.key,
                 v_BlobRecord.the_blob
                );

   END LOOP;    /* Free resources used by the query */    CLOSE c_Blob;

END CopyBlobs;


Received on Tue Mar 25 1997 - 00:00:00 CST

Original text of this message

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