Using subquery in a Check statement in Oracle

后端 未结 5 2024
清歌不尽
清歌不尽 2020-12-11 00:26

So I was trying to work this out but it seems that the last line (the check) doesn\'t allow sub queries in it. Any way to make this work Oracle?

CREATE TABLE         


        
5条回答
  •  鱼传尺愫
    2020-12-11 01:01

    Justin's answer has some good ideas. Another one is to wrap all inserts/updates to the table with a package (a TAPI, if you will), and implement the checks there. You'll need to ensure that all applications use your TAPI. You'll also need to implement some custom locking to protect the constraint from the effects of concurrent activity.

提交回复
热议问题