In very few applications you should need to do cross database queries. So
make sure you got your data architecture is right.

Some sample applications that might need to do this are 1) deployment
scripts 2) cq like apps 3) apps that expose a rest frontend to marklogic
apis.

If you are not coding one of these applications there shouldn't be a need
for cross database queries.

Nuno

On Sun, Feb 13, 2011 at 10:02 PM, Geert Josten <geert.jos...@daidalos.nl>wrote:

> 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
>
_______________________________________________
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to