Home » SQL & PL/SQL » SQL & PL/SQL » UTL_FILE.PUT. Need help to handle the line with more than 32767 characters (Oracle, 11.2, Windows)
UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665553] Sun, 10 September 2017 11:40 Go to next message
sayampub
Messages: 3
Registered: September 2017
Junior Member
Hi,

I need to write an XML content into a file. one of the XML tag in the file contains 40000+ characters. UTL_FILE.PUT_LINE inserting newline(CRLF). Due to this the XML tag missing continuity and entire XML file is in not readable format by the application.

Is there any way to write all the characters in the same line with out splitting into multiple lines. I tried with UTL_FILE.PUT but it doesn't allow to hold the data in the buffer when it reaches max buffer length(32767). If I flush, next PUT writes in to new line(in append mode).

So please help me with an idea to create single line with all characters.

Thanks in advance

Sayampu
Re: UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665555 is a reply to message #665553] Sun, 10 September 2017 12:36 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

http://lmgtfy.com/?q=oracle+xml+%3E+32767+write+to+file

Re: UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665556 is a reply to message #665553] Sun, 10 September 2017 13:45 Go to previous messageGo to next message
Solomon Yakobson
Messages: 3273
Registered: January 2010
Location: Connecticut, USA
Senior Member
Use DBMS_XSLPROCESSOR.CLOB2FILE.

SY.
Re: UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665577 is a reply to message #665555] Mon, 11 September 2017 07:11 Go to previous messageGo to next message
sayampub
Messages: 3
Registered: September 2017
Junior Member
Hi BlackSwan,

Thanks for the quick response. It helped me. I used utl_file.put_raw to put the XML content in the same line. It did not split xml tag.Now my XML file is readable by the application. Thanks a lot for your help.

Thanks,
Sayampu
Re: UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665578 is a reply to message #665556] Mon, 11 September 2017 07:12 Go to previous messageGo to next message
sayampub
Messages: 3
Registered: September 2017
Junior Member
Hi Solomon,

Thanks for your time. I will try with DBMS_XSLPROCESSOR.CLOB2FILE as well.

regards,
Sayampu
Re: UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665640 is a reply to message #665578] Wed, 13 September 2017 13:59 Go to previous messageGo to next message
Bill B
Messages: 1971
Registered: December 2004
Senior Member
use utl_file.put, which does not put a line terminator into the file. When you are done with a line simply call utl_file.new_line and when your all done before the close use utl_file.fflush
Re: UTL_FILE.PUT. Need help to handle the line with more than 32767 characters [message #665642 is a reply to message #665640] Wed, 13 September 2017 17:26 Go to previous message
Solomon Yakobson
Messages: 3273
Registered: January 2010
Location: Connecticut, USA
Senior Member
1. You can't have utl_file.put with total length exceeding 32767.
2. Even if total size is less than 32767 and even if you don't use utl_file.new_line, utl_file.fflush will add CRLF which OP is trying to avoid.

SY.
Previous Topic: Finding Date overlap
Next Topic: wirting automatically multi files by utl_file.fopen
Goto Forum:
  


Current Time: Fri Apr 19 02:49:24 CDT 2024