getting XML from Oracle Tables -
when run
select xmlelement("product", xmlattributes(fp.col2 "attr2",fp.col4 "attr4",fp.col5 "attr5",fp.col6 "attr6") xmlelement(select (xmlelement("dataset", xmlattributes(ds.col3 "attr3") table2 ds fp.col1 = ds.col1 , fp.col2 = ds.col2 , ds.col2='abc')) ) ) table2 fp fp.col1 = 'xyz'
i error
ora-00917: missing comma 00917. 00000 - "missing comma" *cause: *action: error @ line: 5 column: 18
i not able understand why
i expecting output like
<product> <dataset></dataset> </product>
also can point me tutorials / examples xml generated joiing multiple tables. need have closer @ syntax.
most of examples searched had xml generated single table ( employee)
---edit---
i've modified query. should work:
select xmlelement("product" , xmlattributes(fp.col2 "attr2",fp.col4 "attr4",fp.col5 "attr5",fp.col6 "attr6") , ( select xmlelement("dataset" , xmlattributes(ds.col3 "attr3") ) table2 ds fp.col1 = ds.col1 , fp.col2 = ds.col2 , ds.col2='abc' ) ) table2 fp fp.col1 = 'xyz';
in query there unnecessary xmlelement
clause (second one) , before subquery comma missing.
Comments
Post a Comment