sedna

uniqness insertion in native xml database

五迷三道 提交于 2020-01-24 13:00:08
问题 I am developing a project based on XML. I use the Sedna database to store my collection (which contains XML files, and their XSD schema files). I define the primary/unique keys in those schemes, but till now I can insert duplicate values (via XQuery update insert command) into primary key field. 回答1: To guarantee uniqueness constraint you should create BEFORE INSERT FOR EACH NODE trigger on proper path. In the trigger action the $NEW transitive variable can be used to fetch the new key and

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();

Update insert to Xml by sedna via PHP

ぐ巨炮叔叔 提交于 2019-12-06 13:02:15
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