Problema na biblioteca WebUtil !

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Responder
robson.barata
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Mensagens: 8
Registrado em: Ter, 09 Out 2012 9:28 am

Beleza Galera !

Estou precisando muito da ajuda de vocês !

Eu tenho um forms no qual tem um botão chamado "Salvar Arquivo", neste botão tem o seguinte código:

Selecionar tudo

PROCEDURE p_prc_salvar_arquivo IS
	--
  cursor cur_arquivo is
    select 
      t.txt_registro
    from 
      ge_arq_interface_getra T
    where   
      num_arquivo = :ge_vw_interface_getra.num_arquivo
    order by 
      num_linha;

   v_data_hora   varchar2(200) := Null;
   FILENAME      varchar2(200) := Null;
   MYFILE        CLIENT_TEXT_IO.FILE_TYPE;
  CUR_REC       NUMBER;
  --
BEGIN
  
  v_data_hora      := to_char(sysdate,'yyyymmddhhmmss');

  if (upper(:ge_vw_interface_getra.cod_tipo_interface) = 'FATURA') then
    FILENAME := :blk_parametros.DSC_DIRETORIO||'GETRA' || v_data_hora ||'.txt';
  else
    FILENAME := :blk_parametros.DSC_DIRETORIO||'GETRF' || v_data_hora ||'.txt';
  end if;
  --
  [color=#FF0000]MYFILE := CLIENT_TEXT_IO.FOPEN(FILENAME, 'W');[/color]
  --  
  for arq in cur_arquivo loop
    --
    CLIENT_TEXT_IO.PUT_LINE(MYFILE, arq.txt_registro);
    --
  END LOOP;

  CLIENT_TEXT_IO.FCLOSE(MYFILE);
  --
exception  
  when others then
    --
    message('Houve falha na abertura do arquivo. Anote os erros da próxima tela e reporte ao seu analista.');
    message(SQLERRM);
    raise;
  --
end;
Quando eu aciono o botão, ele faz a validação acima, e no momento que chega na parte no qual esta em vermelho ele da a seguinte mensagem de erro: oracle.forms.webutil.file.FileFunctions bean not found. CLIENT_TEXT_IO.fopen will not work.

Pesquisei no google, mas, não obtive exito.
Muito Obrigado,
Robson.
Avatar do usuário
stcoutinho
Moderador
Moderador
Mensagens: 850
Registrado em: Qua, 11 Mai 2011 5:15 pm
Localização: são Paulo - SP

Robson,

Não trabalho com FORMS/REPORTS, mas encontrei alguns artigos que talvez lhe ajudem a avaliar o problema:

http://www.orafaq.com/forum/t/152242/2/
When using WEBUTIL functionnality, you also need to include in your forms the WEBUTIL block, canvas and windows.
All those objects are include in the file webutil.olb
http://www.orafaq.com/forum/t/138991/2/
I fixed it ..Here is the solution..
what i did was create a new trigger WHEN-TIMER-EXPIRED copied all the code from my WHEN-NEW-FORM-INSTANCE and put it in the WHEN-TIMER-EXPIRED and then put the following code into WHEN-NEW-FORM-INSTANCE :
declare
fake_timer TIMER;
begin
--
-- Purpose of the fake timer is the we cannot call webutil in this trigger since the
-- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger
-- it means that this timer will not start running until Forms has focus (and so the webutil
-- beans will be instantiated and so call canbe made.
--
fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
--create_blob_table;
null;
end;
Abraços,

Sergio Coutinho
robson.barata
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Mensagens: 8
Registrado em: Ter, 09 Out 2012 9:28 am

Muito Obrigado Sérgio !
Vou dar uma olhada nos artigos.
Abs,
Robson.
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 13 visitantes