Solved

Send CR/LF using UTL_FILE?

Posted on 2004-04-06
7
2,715 Views
Last Modified: 2009-10-20
Using UTL_FILE, how can I send a carriage-return/line-feed set (0x0d 0x0a) to a file?

Everything I try sends the 4 characters '13' and '10'.
0
Comment
Question by:BrianWren
7 Comments
 

Expert Comment

by:smohan7
ID: 10770296
Brian,
Did you try this?

utl_file.putf(out_file,'\n/\n');

Thanks
Mohan
0
 
LVL 5

Expert Comment

by:mudumbe
ID: 10771107
You can use the one defined in UTL_TCP package:  UTL_TCP.CRLF
0
 
LVL 5

Expert Comment

by:KarcOrigin
ID: 10771237
Hi,
Use UTL_FILE.PUT_LINE

actually there are 2 method UTL_FILE.PUT to print the line on the same line and UTL_FILE.PUT_LINE to print the line and and line break.
Thx
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 8

Expert Comment

by:baonguyen1
ID: 10771428
BrianWren, you can PUT and PUT_LINE. However, there is a different:

Use of PUT_LINE will flush the buffer to file and generate a new line
PUT just puts tring to the buffer. You then need to use FFLUSH  to generate a carriage return and flush the contents the buffer to the file after using the UTL_FILE.PUT procedure.

You also can use PUTF()

Hope this helps
0
 
LVL 9

Author Comment

by:BrianWren
ID: 10775117
I actually asked the wrong question...
(End of a long day...)

What I want to know how to do is send a form feed, 0x0C.

(I fooled myself as well.  I really did try to manually write 0x0D 0x0A to a file.  
 I actually have been using PUT_LINE, and came to this point where I need to
 generate a page.)

aHEm...
  ¯¯

Using UTL_FILE, how can I send a form-feed (0x0c) to a file?

I really apologize for being boneheaded.  
If anyone has an answer to the way to send a FormFeed, i'd really like to know the answer.
0
 
LVL 9

Accepted Solution

by:
pratikroy earned 250 total points
ID: 10779130
I believe form feed (Page Break) character is 12 (0x0c).

So, you can try putting the chr(12) using the UTL_FILE.

I would be eager to know if that works :)
0
 
LVL 9

Author Comment

by:BrianWren
ID: 10779288
CHR() was what I needed to know.

I am a VB programmer, so I knew about CHR(), but I thought Oracle's substitute for that was TO_CHAR(), and I could find no way to make TO_CHAR() act like Chr$() [from VB].

Thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now