Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Problem creating LOB in Oracle 8i
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);
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 - 08:21:37 CST