Solved

Send CR/LF using UTL_FILE?

Posted on 2004-04-06
7
2,780 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.

Question has a verified solution.

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

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

770 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