Ask The Oracle Expert: Questions & Answers

Entity-Attribute-Value constraints

Entity-Attribute-Value constraints

By  Rudy Limeback, SQL Consultant, r937.com

SearchOracle.com

I have some validation rules. There are two tables, NODE and METANODE. Here the METANODE column SUBTYPE will depend on the value of the NODE column NODETYPE. So, if NODETYPE of NODE has a value of 'Role' then SUBTYPE of METANODE might have the value 'Process'.

NODE               METANODE
--------------     ---------------   
NODETYPE : Role    SUBTYPE : Process

How can I put a constraint for this?

This is one of three questions this week, to which, I'm afraid, the answer is no.

[The others were A running total and SQL to update the header records?]

No, I don't think you can declare a constraint.

This looks very much like the entity-attribute-value model. I personally would avoid it. Here are some links for further opinions:

Good luck.