HEY ALL,

I am facing prb with the dbms_output.put_line.

I am writing an SQL procedure and trying to get the output.
My procedur works fine but the I have prb in displaying the output.

Here is the problematic code snippet:

FOR i in 1....lcount LOOP
if(i=lcount) then
dbms_output.put_line('The value is' || user_name);
else
dbms_output.put_line('The present value is' || user_name || 'and');
END IF;
END LOOP;

Here user_name is a string.

Now when I execute the procedure for one condition I get the output as:

The present value is 'User' and
The value is 'Answer'

PL/SQL procedure executed succesfully.

But I want the output as:

The present value is 'User' and The value is 'Answer'

Do anyone know how can I print the dbms.output line in one line instead of 2 seperate lines?
I do not want the else part's dbms output line to print in the next line. I want it in the same line.