uniqness insertion in native xml database
问题 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