Hi Kris,

Consider a small sample and included two sample XML files , try to run the 
query u will get some idea about the document relationship .

for $sales in doc()/Sales, $region in doc()/Region

where $sales/@regID = $region/@regID

return ($sales/product, $region/product)

region.xml

xdmp:document-insert("/region/doc1.xml",<Region regID="1" CountryID 
="011"><product>Regoin Test Product1</product></Region>)

sales.xml

xdmp:document-insert("/sales/doc1.xml",<Sales regID="1" CountryID 
="011"><product>Test Product1</product></Sales>)

Hope  it will help . If you need some specific case , please explain the 
scenario clearly .

thanks and regards
Raja >>>

From: [email protected] 
[mailto:[email protected]] On Behalf Of Cocoram007
Sent: Thursday, September 03, 2015 5:57 PM
To: [email protected]
Subject: [MarkLogic Dev General] Converting SQL Server db to Marklogic ecosystem

Hi,

I am just trying to understand the scenario of converting an existing SQL 
Server relational Db to Marklogic ecosystem.

In SQL, we have tables and relationships between tables

In Marklogic, we handle rows as documents, and we have one document for each 
row of the database table, Is it possible to establish a relationship between a 
group of documents (say a directory) to another directory(another group of 
documents)?

Say, in detail,

We have a Region table and daily Sales transaction table linked by 
Sales.country = Region.Country

In Marklogic, we have Region Directory (Similar to SQL Region Table) and Sales 
Directory(Similar to Sales Transaction Table). How do we link these two 
directories on country?

Can someone please shed some light on this?

Thanks
Kris
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful. Where permitted by applicable law, this e-mail 
and other e-mail communications sent to and from Cognizant e-mail addresses may 
be monitored.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to