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: Trying to use DBMS_LOB package

Re: Trying to use DBMS_LOB package

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 18 Nov 1998 17:29:00 GMT
Message-ID: <3656039a.15702779@192.86.155.100>


A copy of this was sent to Beth Beckman <bbeckman_at_lanl.gov> (if that email address didn't require changing) On Tue, 17 Nov 1998 13:01:09 -0700, you wrote:

>I'm trying to execute procedures (eg. FILEOPEN for a bfile) found in the
>DBMS_LOB package, and I receive the following error messages:
>
>ORA-22285: non-existent directory or file for FILEOPEN operation
>ORA-06512: at "SYS.DBMS_LOB", line 370
>ORA-06512: at line 10
>
>Where are these packages located? Do I have to do anything prior to
>using them? Any clues would be appreciated.
>
>Thanks,
>Beth

You have to create a directory object ( a mapping in the database that points to some OS directory). For example:

create or replace directory MY_FILES as '/export/home/tkyte/public_html';

declare

    l_bfile bfile;
    l_blob blob;
begin

    insert into blobs values ( 'alan.tif', empty_blob() )     return theBlob into l_blob;

    l_bfile := bfilename( 'MY_FILES', 'alan.tif' );     dbms_lob.fileopen( l_bfile );
    dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength(l_bfile) );     commit;
end;
/

First I created a directory MY_FILES, they I can use that directory object in the dbms_lob.bfilename and fileopen calls...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Nov 18 1998 - 11:29:00 CST

Original text of this message

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