Home » SQL & PL/SQL » SQL & PL/SQL » Adding ^M to each line in output file
icon5.gif  Adding ^M to each line in output file [message #302743] Tue, 26 February 2008 19:28 Go to next message
kham2k
Messages: 34
Registered: May 2007
Member
Hello All

I am trying to write to a file using UTL File.

...
detail_buffer:= lpad(nvl(to_char(rec.loc_nbr),'0'),34,'0')||
lpad(nvl(to_char(rec.store_area_nbr),'0'),24,'0')||
lpad(nvl(to_char(rec.upc_id),'0'),12,'0');

UTL_FILE.PUTF(idwfile,detail_buffer||'\n');
...


This is giving me the output as following

Quote:


070591140000023229300000000+000020STRATTERA 40 MG CA000122319
070591160000023235600000000+000030CYMBALTA 20 MG CAP000193119
070591160000023237300000000+000040CYMBALTA 60 MG CAP000108319
070591160000023240300000000+000030CYMBALTA 30 MG CAP000108319





But my requirement is to have with control M(^M) at the end of end record line. something like this

Quote:

000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M
000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M
000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M
000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M
000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M
000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M
000820160885967701260000000+000001SNLGHT POWER PACS 000031421 ^M




How can I add this at end of each line?
Re: Adding ^M to each line in output file [message #302745 is a reply to message #302743] Tue, 26 February 2008 19:48 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
use
||CHR(13)
Previous Topic: Union All improvement
Next Topic: How to pass DATE parameter to View
Goto Forum:
  


Current Time: Tue Feb 11 20:27:16 CST 2025