Using SQL in Query Manager in MarkLogic

浪尽此生 提交于 2019-12-25 04:05:22

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!