HOW TO WRITE ,SAVE A FILE IN BLOB COLUMN
Uday_NOct 6 2010 — edited Oct 6 2010Hi,
I have to write a simple utl file and store it in a column of blob data tye..i hav written a piece of code..it shows invalid path as error..please kindly help me
create or replace
procedure simp_file as
fhandler utl_file.file_type;
f_dir VARCHAR2(100);
f_file VARCHAR2(100);
BEGIN
f_dir := 'C:/utl/';
f_file := 'Kings.txt';
BEGIN
fhandler := utl_file.fopen(f_dir,f_file,'a');
EXCEPTION
WHEN utl_file.invalid_path THEN
f_dir := 'C:/utl/';
fhandler := utl_file.fopen(f_dir,f_file,'a');
END;
utl_file.new_line(fhandler,1);
utl_file.putf(fhandler,'hi');
utl_file.fclose(fhandler);
EXCEPTION
WHEN UTL_FILE.INVALID_PATH THEN
IF (utl_file.is_open(fhandler)) THEN
utl_file.fclose(fhandler);
END IF;
raise_application_error(-20101, 'Invalid path');
END simp_file;