如何设置条件DEFAULT值到oracle中的列而不使用触发器? [英] How to set a conditional DEFAULT value to a column in oracle without using triggers?
本文介绍了如何设置条件DEFAULT值到oracle中的列而不使用触发器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在oracle中将条件DEFAULT值设置为列而不使用触发器?
我想实现以下需求:
How to set a conditional DEFAULT value to a column in oracle without using triggers? I want to achieve following needs:
- 如果flag1= 1,则默认值为Newfield必须为4
- 如果flag1= 2,则默认值为列新字段必须为5。
推荐答案
这是触发器的用途。使用它们。
That's what triggers are for. Use them.
这篇关于如何设置条件DEFAULT值到oracle中的列而不使用触发器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文