JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

Oracle SQL XMLSERIALIZE syntax not supported

Open xiongtx opened this issue 3 years ago • 3 comments

Oracle's XMLSERIALIZE differs from the parser's expectations in that it has a CONTENT keyword. The following example doesn't parse:

SELECT XMLSERIALIZE(CONTENT XMLTYPE('<Owner>Grandco</Owner>')) AS xmlserialize_doc
   FROM DUAL;
2. Unhandled net.sf.jsqlparser.JSQLParserException

1. Caused by net.sf.jsqlparser.parser.ParseException
   Encountered unexpected token: "XMLSERIALIZE" "XMLSERIALIZE" at line 1,
   column 8.
   
   Was expecting one of:
   
       "!"  "(" "*" "NOT" "STRAIGHT_JOIN"

xiongtx avatar Jun 11 '22 22:06 xiongtx

Greetings,

thank you for reporting, I will see what I can do about.

manticore-projects avatar Jun 12 '22 05:06 manticore-projects

Only a special expression of XMLSERIALIZE is supported at the moment

SELECT xmlserialize(xmlagg(xmltext(COMMENT_LINE) ORDER BY COMMENT_SEQUENCE) AS varchar (1024)) FROM mytable GROUP BY COMMENT_NUMBER

wumpz avatar Jun 28 '22 20:06 wumpz

JSqlParserCC.jjt line 4675

wumpz avatar Jun 28 '22 20:06 wumpz