If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > UTL_FILE.PUT usage

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-03, 20:34
feign3 feign3 is offline
Registered User
 
Join Date: Jan 2003
Posts: 19
Question UTL_FILE.PUT usage

I was recently using UTL_FILE.PUT_LINE to write to a text file but realized that the carriage returns PUT_LINE adds were screwing my output up. So I changed the package to UTL_FILE.PUT but now it writes an empty file.... no data at all. I'm wondering if the usage for PUT is the same as it is for PUT.LINE. Here is a sample of my script with PUT instead of PUT_LINE (works fine with PUT_LINE but not with PUT):


LBL_TEXT := 'TEXT HERE';


LBL_OUTPUT := UTL_FILE.FOPEN(OUTPUTPATH,
LBL_FNAME,
'W');


UTL_FILE.PUT(LBL_OUTPUT,
LBL_TEXT);

END;
/
Reply With Quote
  #2 (permalink)  
Old 02-04-03, 04:31
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: UTL_FILE.PUT usage

This is from the documentation (always worth a read!):

Quote:

When you call PUT_LINE, the item that you specify is automatically followed by an end-of-line marker. If you make calls to PUT to build a line, then you must add your own end-of-line marker by calling NEW_LINE. GET_LINE and GET_LINES do not return lines that have not been terminated with a newline character.
Also, you need to close the file with FCLOSE.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On