2 Replies Latest reply: Mar 18, 2010 1:58 PM by 751195 RSS

    dbms_output.put_line  and sqlplus : output truncated to 100 Characters.

    751195
      HI all,

      please see the following script where the variable length is more than a 100 charecters...
      When i run this in sqlplus with SERVEROUTPUT ON, i see the ouput being truncated to 100 charecters.
      sql> ed
      Wrote file afiedt.buf
      
        1  declare
        2     l_var varchar2(400);
        3  begin
        4     l_var := 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefgh
        5     dbms_output.put_line(length(l_var));
        6     dbms_output.put_line(l_var);
        7* end;
        8  /
      130
      abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
      I think I am looking for a sqlplus "SET XXXX..." command, but my search has been futile so far.
      Please advice.

      Thanks,
      John.
        • 1. Re: dbms_output.put_line  and sqlplus : output truncated to 100 Characters.
          Frank Kulash
          Hi, John,

          It looks like your code got truncated around 100 characters, also.

          Aside from that, it works for me, in SQL*Plus 10.1.0.2.0 and 8.0.6.0.0.
          What version of SQL*Plus do you have?

          You're not using a 4-byte character set, are you?
          What happens when you increase the size of l_var to 2000, or 32767?
          • 2. Re: dbms_output.put_line  and sqlplus : output truncated to 100 Characters.
            751195
            Thanks for your reply .. Frank.

            Sorry... I Previewed the post but did not notice my code being truncated in my sqlplus sesssion.
            The actual script has the output to 130 charecters. but when i close the edit (afeidt.buf) and execute it, the display only shows 100 charecters...

            My SQLPLUS version is 9.2.0.1.
            I am using the "WE8ISO8859P1" charecter set.
            declare
                l_var varchar2(500) := 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz';
            begin
                dbms_output.put_line(length(l_var));
                dbms_output.put_line(l_var);
            end;
            /
            
            130
            abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv
            
            
              1  declare
              2      l_var varchar2(500) ;
              3  begin
              4      for i in 1 .. 5 loop
              5          l_var := l_var || 'abcdefghijklmnopqrstuvwxyz';
              6      end loop;
              7      dbms_output.put_line(length(l_var));
              8      dbms_output.put_line(l_var);
              9* end;
            sql> /
            130
            abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv