1 Reply Latest reply: Jan 19, 2013 7:55 AM by Solomon Yakobson RSS

    trim function not working in PL/SQL ( XE 11g R2 )

    985307
      ----PLSQL-----------------------------------------------------------------------------------------------------------
      create or replace
      procedure import_artikli
      as
      v_pos number;
      v_t number;
      v_str varchar2(10000);
      v_trm varchar2(10000);
      begin
      for c1 in (select * from brisi_import_artikli order by rbr) loop
      v_t := instr(c1.text,chr(9));
      dbms_output.put_line(to_char(v_t));
      v_str := substr(c1.text,0,v_t);
      v_trm := trim(v_str);
      dbms_output.put_line(replace(v_trm,' ','|'));
      end loop;
      end;

      --------DBMS OUTPUT-----------------------------------
      19
      W|940/25||||||||||     
      19
      13.0460-7194.2||||     

      v_trm variable never gets trimmed. Checked with debugger too. It just leaves whitespaces.

      Help!