error bxsq0003 in xquery

Monday, 7 September 2015 · 2 messages · last reply 9 Sep 2015
M
michele.greco27 Sep 2015 11:41 #
Hi, i have tihsi error :[bxerr:BXSQ0003] Number of parameters differs from
number of placeholders in this xquery:
declare namespace
w="http://schemas.openxmlformats.org/wordprocessingml/2006/main";
 
declare function local:nome() as xs:string* {
for $document in collection("curriculum")
let $c:= document-uri($document)
order by $c
return
for $e in doc($c)//w:tc[.//text()="Nome"]
return $e/./following::text() except (
for $x in doc($c)//w:tc[.//text()="Indirizzo"]
return $x//following::text())
};
 
let $init := sql:init("com.mysql.jdbc.Driver"),
$conn :=
sql:connect("jdbc:mysql://localhost:3306/DbName","user","password"),
$stmt := sql:prepare($conn, "INSERT INTO person
VALUES('',?,'','','','','')")
for $nome in local:nome()
return sql:ute-prepared($stmt,
<sql:parameters>
<sql:parameter type="string">{$nome}</sql:parameter>
</sql:parameters>)
 
Why?
-- ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per tutti i dettagli Clicca qui http://posta.email.it/caselle-di-posta-z-email-it/?utm_campaign=email_Zimbra_102014=main_footer/f Sponsor: Soluzioni di email hosting per tutte le esigenze: dalle caselle gratuite a quelle professionali su piattaforma Zimbra, da quelle su proprio dominio a quelle certificate PEC. Confronta le soluzioni Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=13326&d=7-9
MG
Maximilian Gärber9 Sep 2015 08:51 #
Hi Michele, could you provide some more information, please? E.g. the complete error message (with line number), the OS and BaseX version etc. Regards, Max 2015-09-07 11:41 GMT+02:00 <michele.greco2 at email.it>:
Quoted text · michele.greco2 · 36 lines
> Hi, i have tihsi error :[bxerr:BXSQ0003] Number of parameters differs from > number of placeholders in this xquery: > declare namespace > w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"; > > declare function local:nome() as xs:string* { > for $document in collection("curriculum") > let $c:= document-uri($document) > order by $c > return > for $e in doc($c)//w:tc[.//text()="Nome"] > return $e/./following::text() except ( > for $x in doc($c)//w:tc[.//text()="Indirizzo"] > return $x//following::text()) > }; > > let $init := sql:init("com.mysql.jdbc.Driver"), > $conn := > sql:connect("jdbc:mysql://localhost:3306/DbName","user","password"), > $stmt := sql:prepare($conn, "INSERT INTO person > VALUES('',?,'','','','','')") > for $nome in local:nome() > return sql:ute-prepared($stmt, > <sql:parameters> > <sql:parameter type="string">{$nome}</sql:parameter> > </sql:parameters>) > > Why? > > ---- > ZE-Light e ZE-Pro: servizi zimbra per caselle con dominio email.it, per > tutti i dettagli clicca qui > > Sponsor: > Registra i domini che desideri ed inizia a creare il tuo sito web > Clicca qui

⚡Generated with XQuery