Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Store large Word or PDF file in DB
Niall Litchfield wrote:
> look into the BLOB datatype (8i and above). You can either store the data
> directly or as a BFILE (external file reference).
>
>
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
> *****************************************
> Please include version and platform
> and SQL where applicable
> It makes life easier and increases the
> likelihood of a good answer
>
> ******************************************
> "cschang" <cschang_at_maxinter.net> wrote in message
> news:3C426609.20709_at_maxinter.net...
>> Is it possible to storage a very larg word file ( more than 4K >> charcaters) or even PDF type file into database? So I can use some kind >> of ID column to be referenced by other . I have a small set of records >> which each row is associated with a larger text file and gif file. So >> I try to put the large word ( or PDF that will include some picture in >> it) into another table but use a foreign ID to reference them. Thanks. >> >> C CHang >>
You have to create a table with a blob column: create table t_blob(id number not null primary key,
blob_file blob);
Custom the following procedure that I copied from a Thread
create or replace procedure blob_ins(p_id in number, p_filename in varchar2) as
l_bfile bfile; l_blob blob;
l_bfile := bfilename('BLOB_DIR', p_filename);
dbms_lob.fileopen(l_bfile); dbms_lob.loadfromfile(l_blob, l_bfile, dbms_lob.getlength(l_bfile)); dbms_lob.fileclose(l_bfile);
This is for loading a binary file in the db, anyone knows how download the file stored in a lob in a new a file of the o.s.? Received on Mon Jan 21 2002 - 14:53:52 CST