Insert file with blanks

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
  

Poston Thu, 24 Nov 2016 3:38 pm

Good afternoon!
I'm in a situation where importing a text file for forms 6 and inserting into a table. Some lines have blank spaces at the end, is correct and I need this information in the table. Like this: " 123 " TEST But when I insert in the table, something erases these blank spaces at the end.

Code: Select all
PROCEDURE recalcula_hash IS
  pl_nm_logico     text_io.file_type;
  pl_ds_linha      varchar2(3500);
  pl_nr_sequencia  number(5) := 0;
BEGIN
  pl_nm_logico := text_io.fopen (:importa_lote.ds_arquivo, 'r');
  loop
    begin
      text_io.get_line(pl_nm_logico, pl_ds_linha);
      pl_nr_sequencia := pl_nr_sequencia + 1;
      insert into TABELA
        (ds_linha
        ,nr_sequencia)
      values
        (pl_ds_linha
        ,pl_nr_sequencia);
        forms_ddl('commit');
    end;
  end loop;
  text_io.fclose(pl_nm_logico);
END;
to show the length of the variable pl_ds_linha matches the size of the row in the file, but when you go to the bank runs out of the blanks.
When I insert without the variable, with a text (test) dai will correct for the Bank.

Code: Select all
insert into TABELA
        (ds_linha
        ,nr_sequencia)
      values
        ('TESTE 123     ' --pl_ds_linha
        ,pl_nr_sequencia);
I can't use a RPAD for example, because there are many different files with different sizes, so I have no way of knowing which is the size of each ...

Since now, thank you!
fernandahabi

Poston Thu, 24 Nov 2016 3:50 pm

Attempts to change the variable to pl_ds_linha char (3500);

Sometimes it works.
spernega
Location: São Paulo - SP



Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests