Hi Geert, It was a path problem, I'm using different modules in different way and for each way I need a sql.xqy in a different directory. For modules invoked by triggers I need sql.xqy in the MarkLogic Modules directory. For the others (calling in an Ant script by curl) I need a sql.xqy in the /app/ directory of my Database. In this way all is ok. Thank you for your help ! Kind regards,Arnaud > From: [email protected] > To: [email protected] > Date: Thu, 26 Aug 2010 15:31:55 +0200 > Subject: Re: [MarkLogic Dev General] trigger issue > > Hi Arnaud, > > In general the exception often is an indication that the xqy file could not > be found or is inaccessible to the user that tries to execute it. Use the > database explore function of CQ to check whether the xqy is really where you > think it is, whether it has the right permissions and is inserted as the > correct type (text).. > > Kind regards, > Geert > > > > > > drs. G.P.H. (Geert) Josten > Consultant > > Daidalos BV > Hoekeindsehof 1-4 > 2665 JZ Bleiswijk > > T +31 (0)10 850 1200 > F +31 (0)10 850 1199 > > mailto:[email protected] > http://www.daidalos.nl/ > > KvK 27164984 > > > De informatie - verzonden in of met dit e-mailbericht - is afkomstig van > Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit > bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit > bericht kunnen geen rechten worden ontleend. > > > From: [email protected] > > [mailto:[email protected]] On Behalf Of > > Arnaud Roch > > Sent: donderdag 26 augustus 2010 12:53 > > To: [email protected] > > Subject: [MarkLogic Dev General] trigger issue > > > > Hi (again), > > > > I've another problem with a trigger. The trigger look like this : > > > > import module namespace trgr="http://marklogic.com/xdmp/triggers" > > at "/MarkLogic/triggers.xqy"; > > trgr:create-trigger("InsertSQL", "Insert trigger for MLSQL to > > SQL Server", trgr:trigger-data-event( > > trgr:directory-scope("/Data/Sample/", "infinity"), > > trgr:document-content("create"), trgr:post-commit()), > > trgr:trigger-module(xdmp:database("MarkLogicAccess"), > > "/app/", "InsertSQL-NoDyn-Trigg.xqy"), fn:true(), > > xdmp:default-permissions() ) > > > > It call this module : > > > > import module namespace sql ="http://xqdev.com/sql" at > > "/app/sql.xqy"; import module namespace > > trgr="http://marklogic.com/xdmp/triggers" at > > "/MarkLogic/triggers.xqy"; > > > > declare variable $trgr:uri as xs:string external; > > > > let $p := fn:doc($trgr:uri)/* > > return > > sql:execute( > > "INSERT INTO [dbo].[Product] > > ([Field1],[Field2],...,[FieldN]) VALUES > > (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? > > ,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? > > ,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? > > ,?,?,?,?,?) ", > > "http://serverIP:8080/mlsql/mlsql", > > sql:params( ($p/Field1,$p/Field2,...,$p/FieldN) > > ) > > > > So, when I upload 1 file with recordLoader or drag&drop in > > webdav or xdmp:document-load() I have this error : > > 2010-08-26 10:54:14.410 Notice: MarkLogicAccess-xdbc-9041: > > XDMP-TEXTNODE: /app/sql.xqy -- Server unable to build program > > from non-text document > > 2010-08-26 10:54:14.410 Notice: MarkLogicAccess-xdbc-9041: in > > /InsertSQL-NoDyn-Trigg.xqy [1.0-ml] > > > > I've try this manipulation with another module (log.xqy like > > in the tutorial with a xdmp:log(fn:concat("doc ",$trgr:uri," > > created")) ) and there is no problem, the trigger was created > > like the one at the top of this mail (just change module name)! > > > > Someone can help me ? > > > > Thank you ! > > > > Kind regards > > Arnaud > > > > > _______________________________________________ > General mailing list > [email protected] > http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
