[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Send CR/LF using UTL_FILE?

Posted on 2004-04-06
7
Medium Priority
?
3,192 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
Suggested Courses
Course of the Month18 days, 15 hours left to enroll

834 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