Only allow the transfer of files sent and recorded on the station (temporary), to the user’s machine after all processed

Asked

Viewed 31 times

0

Someone can help me, such as just downloading the temporary file to the user folder after processed. Below is an example.

Example:

Temporary Station: Recorded files

S-29012021-007-0000192.txt S-29012021-008-0000192.txt S-29012021-009-0000192.txt

Only Allow Transfer Generated Files to User Folder after All Recorded.

Folder User:

S-29012021-007-0000192.txt S-29012021-008-0000192.txt S-29012021-009-0000192.txt

---------------------------- Brief summary Process --------------------

-------total records and generated----------- BEGIN SELECT COUNT (1), COUNT (DISTINCT cod_client) INTO v_total, v_arqvo_total FROM debits to WHERE tpo_debito = 'A' AND sit_proc ='I'; EXCEPTION WHEN OTHERS THEN msg_alert ('Totalization Error', 'I', TRUE); END;

-----Incremented value on length of progress bar------ v_factor := (1 / v_reg_total) * 3;

FOR i IN c_deb LOOP v_qtd := v_qtd_+ 1; v_width := v_width + v_fat; percentage := TRUNC ((100 * v_qtd) / v_total,, 0);

        sequ_linha;
        
          TEXT_IO.put_line (arqvo,
                       'Z'
                    || SUBSTR (TO_CHAR (v_tot_registros + 2, '000000'), 2, 7)
                    || SUBSTR (TO_CHAR (v_valor * 100, '00000000000000000'), 2, 20)
                    || LPAD (' ', 120, ' ') 
                    || LPAD (v_dc_seq_linha, 06, ' ')
                    || ' '
                    || CHR (13)
                    );

        TEXT_IO.fclose (arqvo);

      
        -- AQUI FAZ O DOWNLOAD DO ARQUIVO TEMPORÁRIO PROCESSADO NO SERVIDOR PARA A PASTA USUARIO
           uK_download (v_dir_arq_proc, v_nome_arqvo, v_arq_temp);           
     
        
        v_atualiza := 'S';
        v_abriu_arq := 'N';
     END IF;

     v_primeiro := 'N';
     v_tot_valor := 0;
     v_tot_registros := 0;
     v_seq_linha := 0;
  END IF;

  IF v_abriu_arq = 'N' THEN
     
     --Contagem do arquivo que está sendo gerado--
     v_arq_atual := v_arq_atual + 1;
        
    
     v_nme_arqvo := 'S-' || Identificador || '-' || 
               TO_CHAR(SYSDATE, 'DDMMYYYY') || '-' || 
               LPAD (cod_cliente,3,0) || '-' ||
               LPAD (v_seq, 7, '0') ||'.txt' ;
 
     -- AQUIVO TEMPORÁRIO (GERADO NO SERVIDOR)
     BEGIN
        SELECT LOWER (nme_path_tmp
                   || LPAD (seq_arq_tmp.NEXTVAL, 4, '0')
                   || '.PROC' )
          INTO v_arqvo_tmp
          FROM controle;

               
       arquivo := TEXT_IO.fopen (v_arq_temp, 'W');
                 
     EXCEPTION
        WHEN OTHERS THEN
           msg_alert ('ERRO AO CRIAR ARQUIVO : ' || v_arq_temp, 'I', FALSE);
           SYNCHRONIZE;
           RETURN;
     END;

If anyone can help me... Thank you.

  • The idea is only to let it transfer after all processed files, not like this one today, transferring from one to one, and if a problem occurs, or power falls, avoids duplicities..

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.