My Oracle Support Banner

Pretty-Print XML in SQL*Plus Wraps After 80 Characters. How to Prevent this? (Doc ID 1372684.1)

Last updated on AUGUST 04, 2018

Applies to:

Oracle Server - Enterprise Edition - Version: to - Release: 10.2 to 11.2
Information in this document applies to any platform.


When attempting to pretty-print XML using xmlserialize() from SQL*Plus, the output always wraps after 80 characters.

Please see the following example:

SQL> set long 200000
SQL> set linesize 132

SQL> SELECT xmlserialize(Document XMLELEMENT (TEST,
  2  xmlattributes ('attribute1' AS a1,
  3  'attribute2' AS a2,
  4  'attribute3' AS a3,
  5  'attribute4' AS a4,
  6  'attribute5' AS a5
  7  ),
  8  XMLELEMENT (test2, 'test2 value')
  9  ) indent )

<TEST A1="attribute1" A2="attribute2" A3="attribute3" A4="attribute4" A5="attrib
ute5">  <----
 <TEST2>test2 value</TEST2>

What formatting option needs to be specified in SQL*Plus so that the output does not wrap after 80 characters?


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.