| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Copying rows with LONG RAW field to another database
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;
![]() |
![]() |