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;
  pl_nm_logico := text_io.fopen (:importa_lote.ds_arquivo, 'r');
      text_io.get_line(pl_nm_logico, pl_ds_linha);
      pl_nr_sequencia := pl_nr_sequencia + 1;
      insert into TABELA
  end loop;
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
        ('TESTE 123     ' --pl_ds_linha
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!

Poston Thu, 24 Nov 2016 3:50 pm

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

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

Return to Forms

Who is online

Users browsing this forum: No registered users and 5 guests