A workaround to this is to supply a default value to the not NULL column whose value comes from a BEFORE INSERT TRIGGER, so that the constraint is not violated.
一种解决方法是给从BEFORE INSERT触发器取得值的NOT null列提供默认值,这样就不会违反约束。
In Oracle 10g, if there is a BEFORE INSERT TRIGGER and a NOT NULL constraint on a table, then the BEFORE TRIGGER is executed first, and then the constraint check is performed.
在Oracle 10 g中,如果表上同时存在BEFORE INSERT触发器和NOT NULL约束,那么先执行BEFORE触发器,然后执行约束检查。
Note: Alternatively you can create a database trigger to capture every INSERT on your table and tell it to validate the data as XML using the XMLVALIDATE function before performing the INSERT.
注意:您也可以选择创建一个数据库触发器来捕捉表上的每个INSERT操作,并告诉它在执行INSERT之前使用XMLVALIDATE函数验证XML数据。
应用推荐