Hi Priyanka,
Just a small addition to David's explanation: Skip the (library) module header. For Scheduled Tasks you will need a main module. E.g. an xquery file without the declare module line, and an expression on top level. Kind regards, Geert *Van:* general-boun...@developer.marklogic.com [mailto: general-boun...@developer.marklogic.com] *Namens *David Lee *Verzonden:* vrijdag 31 januari 2014 13:31 *Aan:* MarkLogic Developer Discussion *Onderwerp:* Re: [MarkLogic Dev General] module to join two xml files First you need a module header then try this manually by using xdmp:invoke() A module header looks like declare module namespace mine="/mycompany/mymodule" ; Put that as the first line and store it in the Modules database (or some other database you want to use as modules) Test that you can invoke this manually using xdmp:invoke() Then in the Create Scheduled Task page, in the admin GUI (port 8001) Groups - > Default -> Scheduled Tasks when you create a scheduled task you set the MOdules database (where this code lives) AND the Database (where the default DATA database lives) that should do it *From:* general-boun...@developer.marklogic.com [ mailto:general-boun...@developer.marklogic.com<general-boun...@developer.marklogic.com>] *On Behalf Of *priyank...@dell.com *Sent:* Friday, January 31, 2014 7:22 AM *To:* general@developer.marklogic.com *Subject:* [MarkLogic Dev General] module to join two xml files *Dell - Internal Use - Confidential * Hi All, //Query to join 2 xml files <books-with-prices> { for $b in doc()//book, $a in doc()//book1 where $b/title = $a/title return <book-with-prices> { $b/title } <price-bstore2>{ $a/price/text() }</price-bstore2> <price-bstore1>{ $b/price/text() }</price-bstore1> <year-bstore1>{ $b/year/text() }</year-bstore1> <date-bstore1>{ $b/date/text() }</date-bstore1> </book-with-prices> } </books-with-prices> I have executed this query successfully on Query Console. The requirement is to write a MODULE for the same query so that it can be used for scheduling. How to specify URI root(database) while scheduling the task? [image: cid:image002.jpg@01CE76A2.FBCB7E80] *Priyanka L* Senior Engineer - BIG DATA Business Innovation Services - BIDW Dell Services Email:priyank...@dell.com| Mobile:+91 9945785355
<<image001.jpg>>
_______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general