0

After inserting few XML records in ML8, I was able to query them using XQuery through Query Console..

Lets say following XML's are there:

enter image description here

Say one XML contains data like:

    <?xml version="1.0" encoding="UTF-8"?>
     <Providers>
      <Provider>
       <ProviderId>1111</ProviderId>
       <Name>John Doe</Name>
       <Age>40</Age>
       <Country>MN</Country>
      </Provider>
      <Provider>
       <ProviderId>2222</ProviderId>
       <Name>Jane Doe</Name>
       <Age>42</Age>
       <Country>MS</Country>
      </Provider>
     </Providers>

There is an option to use SQL in query manager, can that be used here to run queries or some configurations are needed so that SQL can be used directly. If yes, any example will be very helpful.

2 Answers 2

3

It's not possible to run SQL Queries directly on the XML - this needs to be configured, there is a good step-by-step guide here: https://docs.marklogic.com/guide/sql/setup

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Marcin.. will go through the steps.
3

It should also be noted that the model is, one-row = one-document, so you may need to revamp how you are loading your XML here.

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.