DECLARE
file_handle UTL_FILE.FILE_TYPE;
b_lob BLOB;
cursor my_blob is
select (select n.imagedata
from appl_nciic_thirteen n
where n.appl_no = p.appl_no) as pic,
(select b.file_id
from appr_cust_biology b
where b.bio_type = 'FACE'
and b.cust_no = m.cust_no
and rownum = 1) as file_num
from EDSOP.wu_temp2 p, appl_main_info m
where m.apply_no = p.appl_no;
BEGIN
for blob_t in my_blob loop
file_handle := utl_file.fopen('XP_DIR', blob_t.file_num||'.jpg', 'W',32767);
utl_file.PUT_RAW(file_handle, blob_t.pic, true);
UTL_FILE.FCLOSE(file_handle);
END LOOP;
END;
/
file_handle UTL_FILE.FILE_TYPE;
b_lob BLOB;
cursor my_blob is
select (select n.imagedata
from appl_nciic_thirteen n
where n.appl_no = p.appl_no) as pic,
(select b.file_id
from appr_cust_biology b
where b.bio_type = 'FACE'
and b.cust_no = m.cust_no
and rownum = 1) as file_num
from EDSOP.wu_temp2 p, appl_main_info m
where m.apply_no = p.appl_no;
BEGIN
for blob_t in my_blob loop
file_handle := utl_file.fopen('XP_DIR', blob_t.file_num||'.jpg', 'W',32767);
utl_file.PUT_RAW(file_handle, blob_t.pic, true);
UTL_FILE.FCLOSE(file_handle);
END LOOP;
END;
/