Update insert to Xml by sedna via PHP

好久不见. 提交于 2019-12-07 23:25:38

问题


I'm trying to insert new item to Xml file with this code

$conn = sedna_connect($host,$database,$user,$password);
$path = dirname(__FILE__) . '/ADEDB.xml';
$file = file_get_contents($path);
sedna_load($file, 'ADEDB');

sedna_tweak_opt(SE_OPTID_AUTOCOMMIT, false);
sedna_transact_begin();

sedna_execute('
UPDATE insert 
<Employee id="3">
 <name>Louay Hamada</name>
 <bday>21/01/1986</bday>
 <reg>Homs</reg>
 <adrs>Mazzeh</adrs>
</Employee>
into doc("ADEDB")/HRSystem/Employees
');

sedna_transact_commit();
sedna_tweak_opt(SE_OPTID_AUTOCOMMIT, true);

I know that my code would be worng, but I'm not found any document or examples that helps me to pass this problem :(


回答1:


There are Sedna event logs (SEDNA_HOME/data/event*.log files). Have you checked them? Is there any error message?

Have you tried to run the same update statement via se_term (Sedna Terminal)? Try also to run doc("ADEDB")/HRSystem/Employees query to see if it returns anything at all.

Do you have namespaces in your document?



来源:https://stackoverflow.com/questions/17040473/update-insert-to-xml-by-sedna-via-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!