0
我想執行的塞德娜數據庫中的XQuery來有條件地更新容器,如下條件插入XQuery的錯誤失敗的「意外插入,希望別人」
if(fn:exists(doc("blog")/entries/entry[@active="1" and @id="1"]/comments)) then
UPDATE insert <comment active="1"><name>sunil.s</name><email>[email protected]</email><desc>desbbh</desc></comment> into doc("blog")/entries/entry[@active="1" and @id="1"]/comments
else
UPDATE insert <comments><comment active="1"><name>sunil.s</name><email>[email protected]</email><desc>sdd</desc></comment></comments> into doc("blog")/entries/entry[@active="1" and @id="1"]
但此查詢總是與下面的錯誤
失敗SEDNA消息:錯誤XPST0003如果表達式爲 不是A.1 EBNF中定義的語法的有效實例,則爲靜態錯誤。詳細說明:在 (2:8),語法錯誤,意想不到的插入,期待其他
該錯誤表明它在第二行的期待代替else
insert
。
有人可以幫我理解查詢和可能的修復問題嗎?