Hi Sujan,

This is easiest done with xdmp:eval. You wrap the xdmp:document-insert call 
within an xdmp:eval call, while passing the xdmp:eval an option that tells 
which documents database it should use. Also, you need to specify some external 
variables to pass through whatever you want to insert into modules. Something 
like this (might contain typos):

xdmp:eval(
"xquery version '1.0-ml';
 declare variable $url external;
 declare variable $doc external;
 xdmp:document-insert($url, $doc)
",
(xs:QName("url"), $myurl, xs:QName("doc"), $mydoc),
<options xmlns="xdmp:eval">
  <database>{xdmp:database('MyDatabase')}</database>
</options>
)

You will see such code a lot in deployment scripts. There are other ways to 
deploy as well..

Kind regards,
Geert

-----Oorspronkelijk bericht-----
Van: general-boun...@developer.marklogic.com 
[mailto:general-boun...@developer.marklogic.com] Namens annemsu...@gmail.com
Verzonden: zondag 13 februari 2011 21:57
Aan: general@developer.marklogic.com
Onderwerp: [MarkLogic Dev General] (no subject)

Hi,

Am working in one DB(lets say 'eg_db'). Now i want to insert a document using 
xdmp:document-insert into the another DataBase( eg. Modules). Please let me knw 
how to proceed wid this.

Thanks & Regards
Sujan Reddy A
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to