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
