1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| create table tab_lob ( titi varchar(2), toto blob);
insert into tab_lob values ('1',empty_blob());
CREATE DIRECTORY TMP_DIR as '/ton_Partage/';
-- chemin où tu va mettre ton pdf avant de l'inserer en base
grant read on directory TMP_DIR to user;
create or replace procedure essai is
lobd blob;
fils bfile := bfilename ('TMP_DIR','tata.pdf');
amt integer :=4000;
begin
select toto into lobd from tab_lob for update;
dbms_lob.fileopen(fils,dbms_lob.file_readonly);
amt:=dbms_lob.getlength(fils);
dbms_output.put_line(amt);
dbms_lob.loadfromfile(lobd,fils,amt);
commit;
dbms_lob.fileclose(fils);
end;
/
|
Partager