Problem creating LOB in Oracle 8i

From: RS <rs_at_rshome.u-net.com>
Date: Sun, 28 Jan 2001 14:21:37 -0000
Message-ID: <4WVc6.518$i54.799937_at_newsr1.u-net.net>


I'm experimenting with Oracle LOBs for the first time, and have created a simple table to hold a BLOB object.. (Oracle 8i, Linux)

I've then written a procedure to read in a OS file into a BFILE and then use that BFILE to create the BLOB object in the database...

Here is my code...

PROCEDURE LOB_TEST
IS

       image_bfile BFILE := BFILENAME('TMP_DIR','me.jpg');
       image_blob  BLOB;

BEGIN
     DBMS_OUTPUT.ENABLE;

     DBMS_LOB.FILEOPEN (image_bfile,dbms_lob.file_readonly);

         DBMS_OUTPUT.PUT_LINE (    DBMS_LOB.GETLENGTH(image_bfile)    );

         SELECT image INTO image_blob FROM LOB_TABLE FOR UPDATE;

         dbms_lob.loadfromfile (image_blob, image_bfile, 4000,1,1);

         COMMIT;

     DBMS_LOB.FILECLOSE(image_bfile);

END; The procedure compiles ok, but when I run it I get the following error...
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.DBMS_LOB", line 578
ORA-06512: at "RJS.LOB_TEST", line 18
ORA-06512: at line 2

Line 18 is dbms_lob.loadfromfile (image_blob, image_bfile, 4000,1,1);

I've tried using different values in the numeric arguments, but no luck. The DIRECTORY object has already been created succesfully.

Can anyone point me in the right direction here... I've come to a dead end.

Thanks in advance. Replies by email also please.

Richard Received on Sun Jan 28 2001 - 15:21:37 CET

Original text of this message