43: BEGIN
44: Src_Loc := BFILENAME(p_dir_name,p_file_name);
45:
46: --open the BFile
47: DBMS_LOB.OPEN(Src_Loc,DBMS_LOB.LOB_READONLY);
48: l_src_opened := true;
49:
50: OPEN c_get_next_lob_id;
51: FETCH c_get_next_lob_id INTO l_LOB_ID;
78: returning file_data into Dest_Loc;
79:
80:
81: --Now, open the lob
82: DBMS_LOB.OPEN(Dest_Loc,DBMS_LOB.LOB_READWRITE);
83:
84: l_dest_opened := true;
85:
86: --Now, load the lob from BFILE
83:
84: l_dest_opened := true;
85:
86: --Now, load the lob from BFILE
87: DBMS_LOB.LOADFROMFILE(Dest_Loc,Src_Loc,Amount);
88:
89: DBMS_LOB.CLOSE(DEST_LOC);
90: DBMS_LOB.CLOSE(Src_Loc);
91:
85:
86: --Now, load the lob from BFILE
87: DBMS_LOB.LOADFROMFILE(Dest_Loc,Src_Loc,Amount);
88:
89: DBMS_LOB.CLOSE(DEST_LOC);
90: DBMS_LOB.CLOSE(Src_Loc);
91:
92: EXCEPTION
93: when others then
86: --Now, load the lob from BFILE
87: DBMS_LOB.LOADFROMFILE(Dest_Loc,Src_Loc,Amount);
88:
89: DBMS_LOB.CLOSE(DEST_LOC);
90: DBMS_LOB.CLOSE(Src_Loc);
91:
92: EXCEPTION
93: when others then
94: if (l_dest_opened) then
91:
92: EXCEPTION
93: when others then
94: if (l_dest_opened) then
95: DBMS_LOB.CLOSE(DEST_LOC);
96: end if;
97: if (l_src_opened) then
98: DBMS_LOB.CLOSE(Src_Loc);
99: end if;
94: if (l_dest_opened) then
95: DBMS_LOB.CLOSE(DEST_LOC);
96: end if;
97: if (l_src_opened) then
98: DBMS_LOB.CLOSE(Src_Loc);
99: end if;
100: raise;
101:
102: END;