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: Jason Ford <Jason.Ford_at_msfc.nasa.gov>
Date: 1997/03/26
Message-ID: <333952c7.14060415@news>#1/1

On Tue, 25 Mar 1997 22:14:42 GMT, dathedba_at_mindspring.com (Doug Anderson) wrote:

>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;
>_______________________________
>
>- Doug Anderson
> Oracle Database Administrator
> DAtheDBA_at_mindspring.com
>

I believe this will only work for long raw data with a length of 32760 bytes or less. Received on Wed Mar 26 1997 - 00:00:00 CST

Original text of this message

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