?
Solved

Send CR/LF using UTL_FILE?

Posted on 2004-04-06
7
Medium Priority
?
3,022 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

777 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