Trouble using wpg_docload.download_file with BLOB variable
The code below used to work, but we think some change of environment made it stop working:
procedure download (p_seq IN number) is
p_arquivo blob;
encrypted blob;
v_size INTEGER;
--content_type blob;
begin
select arquivo
into encrypted
from arh_declaracoes_bem
where seq = p_seq;
if (encrypted is not null) and INSTR(crpk_parametros.get_string('PARAMETER'), ','||USER||',') <> 0 then
DBMS_LOB.CREATETEMPORARY(p_arquivo, TRUE, DBMS_LOB.CALL);
DBMS_CRYPTO.Decrypt(
dst => p_arquivo,
src => encrypted,
typ => DBMS_CRYPTO.AES_CBC_PKCS5,
key => hextoraw ('<--Actual key not shown here-->')
);
-- get size