0

I select data from an Oracle SQL database using XMLELEMENTs. These data get passed to an application that will convert it into JSON and then sends it to a REST API.

Currently, I have the same issue as here, and the solution should be to add <?xml-multiple?> as a tag.

How can I select it from the database?

SELECT XMLEMENT("Body", 
XMLELEMENT("User", 
XMLELEMENT("Name", UserName), 
XMLELEMENT("Adress", Adress))) 
FROM USERS;

Let's say I want to mark that there could be multiple users with xml-multiple. How do I need to change my query?

1 Answer 1

0

How about using the XMLPI function. It allows you to add processing instructions to the XML.

SELECT XMLEMENT("Body", 
XMLPI("xml-multiple"),
XMLELEMENT("User", 
XMLELEMENT("Name", UserName), 
XMLELEMENT("Adress", Adress))) 
FROM USERS;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.