You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] JSQLParser 5.4-SNAPSHOT : PostgreSQL : XMLTable function not supported #2326
CREATE TABLE xmldata (
id SERIAL PRIMARY KEY, -- optional, just for uniqueness
data XML NOT NULL -- the XML column
);
-- Optional: Insert some dummy XML for testing
INSERT INTO xmldata (data) VALUES
(
'<ROWS>
<ROW id="1">
<COUNTRY_NAME>Canada</COUNTRY_NAME>
<COUNTRY_ID>CA</COUNTRY_ID>
<SIZE unit="sq_km">9984670</SIZE>
<PREMIER_NAME>Justin Trudeau</PREMIER_NAME>
</ROW>
<ROW id="2">
<COUNTRY_NAME>France</COUNTRY_NAME>
<COUNTRY_ID>FR</COUNTRY_ID>
<SIZE unit="sq_mi">248573</SIZE>
</ROW>
</ROWS>'
);
SELECT xmltable.*
FROM xmldata,
XMLTABLE('//ROWS/ROW'
PASSING data
COLUMNS id int PATH '@id',
ordinality FOR ORDINALITY,
"COUNTRY_NAME" text,
country_id text PATH 'COUNTRY_ID',
size_sq_km float PATH 'SIZE[@unit = "sq_km"]',
size_other text PATH
'concat(SIZE[@unit!="sq_km"], " ", SIZE[@unit!="sq_km"]/@unit)',
premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');```
Activity
feat: add support for the XMLTABLE table function
Drop redundant no-arg constructors flagged by Codacy
feat: add support for the XMLTABLE table function (JSQLParser#2458)