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:
Dig Deeper on Oracle development languages
Related Q&A from Rudy Limeback
Read SQL expert Rudy Limeback's advice for counting combinations in a table with SQL's GROUP BY clause Continue Reading
Read about the Mimer Validator, a tool used to verify your SQL code, in this tip from SQL expert Rudy Limeback. Continue Reading
Read an example of an SQL case expression from our SQL expert Rudy Limeback. Continue Reading