Home » SQL & PL/SQL » SQL & PL/SQL » new line sign
new line sign [message #161020] Wed, 01 March 2006 07:58 Go to next message
fabi
Messages: 26
Registered: February 2006
Junior Member
hi. how can i use new line sign (\n) in dbms_output.putline???
dbms('Hi my name is lukas'). i want lukas in new line.

thanks
Re: new line sign [message #161023 is a reply to message #161020] Wed, 01 March 2006 08:01 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
SQL> SET SERVEROUTPUT ON
SQL> EXEC DBMS_OUTPUT.PUT_LINE('Hi my name is ' || CHR(13) || CHR(10) || 'lukas.');
Hi my name is
lukas.
 
PL/SQL procedure successfully completed.
 
SQL>
Re: new line sign [message #161026 is a reply to message #161020] Wed, 01 March 2006 08:10 Go to previous messageGo to next message
fabi
Messages: 26
Registered: February 2006
Junior Member
wow what is CHR(13) CHR(10)????
Re: new line sign [message #161028 is a reply to message #161026] Wed, 01 March 2006 08:15 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
Quote from Fabi

wow what is CHR(13) CHR(10)????

Carriage return and line feed (\r\n).

That's how you mark the end of a line in the Windows world.

Note, in UNIX, the end of a line is simply CHR(10). You should see which option works for your Oracle setup.
Re: new line sign [message #161029 is a reply to message #161020] Wed, 01 March 2006 08:19 Go to previous messageGo to next message
fabi
Messages: 26
Registered: February 2006
Junior Member
thank you
Re: new line sign [message #421326 is a reply to message #161029] Mon, 07 September 2009 09:12 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Hi All,

I am able to insert new line character in DBMS_OUTPUT.PUT_LINE but same is not working when concatenating procedure variables.

My code is like :
*some code
for rec2 in get_seg2(v_value,v_org)
loop
   v_conc_segs2:=v_conc_segs2||CHR(13)||CHR(10)||rec2.cs;
   EXIT WHEN get_seg2%NOTFOUND;
end loop;
v_conc_segs:=v_conc_segs2;
end if;
dbms_output.put_line(v_conc_segs);
*some code

I am getting the error below:
ORA-20000: ORU-10028: line length overflow, limit of 255 chars per line

Please suggest something!!

Thanks in advance..

Regards,
Suman
Re: new line sign [message #421328 is a reply to message #421326] Mon, 07 September 2009 09:18 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
In older versions of Oracle dbms_output.put_line can not output more than 255 characters.
Re: new line sign [message #421329 is a reply to message #421326] Mon, 07 September 2009 09:21 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Output within the loop for each iteration.
Re: new line sign [message #421331 is a reply to message #421329] Mon, 07 September 2009 09:28 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Thanks sir..
But I am using this code in formula column of rdf report so not possible to retun more than one row at a time but my query is fetching 311 rows.
Is there any way to handle this..

Regards,
Suman
Re: new line sign [message #421332 is a reply to message #161020] Mon, 07 September 2009 09:34 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
remove the calls to dbms_output - the report has no use for them.
Re: new line sign [message #421336 is a reply to message #421332] Mon, 07 September 2009 09:53 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Quote:
remove the calls to dbms_output - the report has no use for them.

Unless you're doing something really stupid and reading back using DBMS_OUTPUT.GET...

You're not doing that, are you?
Re: new line sign [message #421341 is a reply to message #161020] Mon, 07 September 2009 10:01 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
fabi wrote on Wed, 01 March 2006 14:58
hi. how can i use new line sign (\n) in dbms_output.putline???
dbms('Hi my name is lukas'). i want lukas in new line.

thanks

Mybe simply:
SQL> begin
  2  DBMS_OUTPUT.PUT_LINE('Hi my name is 
  3  Lukas');
  4  end;
  5  /
Hi my name is
Lukas

PL/SQL procedure successfully completed.

Regards
Michel

Re: new line sign [message #421343 is a reply to message #421341] Mon, 07 September 2009 10:04 Go to previous messageGo to next message
pablolee
Messages: 2882
Registered: May 2007
Location: Scotland
Senior Member
Fabi got an answer a while ago Michel, it's suman.g with a similar question now Wink
Re: new line sign [message #421344 is a reply to message #421343] Mon, 07 September 2009 10:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
/forum/fa/1587/0/

Regards
Michel
Re: new line sign [message #421380 is a reply to message #421344] Tue, 08 September 2009 00:35 Go to previous message
suman.g
Messages: 89
Registered: June 2009
Member
Hi Seniors,

Quote:
Unless you're doing something really stupid and reading back using DBMS_OUTPUT.GET...

You're not doing that, are you?


Actually I was trying to run my script(function) seperately in SQL Developer instead of running in report to test,so I used dbms_output.. to get output string.. (Sorry I was not specific Sad ).

Anyways it's working fine with the same code when directly ran in report Smile ..the problem was with dbms_output... only.

Thanks a lot...

Regards,
Suman

Previous Topic: ORA-24334- no descriptor for this position
Next Topic: select query failing
Goto Forum:
  


Current Time: Wed Feb 12 21:14:18 CST 2025