问题
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:
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.
回答1:
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
回答2:
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.
来源:https://stackoverflow.com/questions/28741156/using-sql-in-query-manager-in-marklogic