constraint on type object in oracle
От | Florent Garcin |
---|---|
Тема | constraint on type object in oracle |
Дата | |
Msg-id | 43be6384$1@epflnews.epfl.ch обсуждение исходный текст |
Ответы |
Re: constraint on type object in oracle
|
Список | pgsql-general |
Hello! I've a project to implement in oracle using odmg and I'm stuck... Assume that we have the following script: create or replace type Tmyenum is object ( myenum varchar2(10) ); create or replace type a is object ( ... ); create or replace type b under a ( bla Tmyenum, ... ); create or replace type c under a ( ... ); create table bigA of a; So, we can see that a is like a superclass of b and c. Now, I would like to set a constraint on Tmyenum which check if the inserted value is in a given set. Something like constraint check_myenum check (myenum in ('blue', 'red', ...)). I don't know if it's possible to add a constraint directly on the type definition. If it's not, I though to put it on the table bigA with a trigger or something. In that case, how do you check if the inserted row is from type b or c in the trigger? Thank you in advance! Florent
В списке pgsql-general по дате отправления: