SubType: Process (This NodeId & SubType are column)
Here NodeId ofboth the table are the primary key of that table.There is no FOREIGN Key between this two table.
But there is a validation rules between this two table...i.e. the SubType of MetaNodeTable depends on the NodeType of NodeTable
Example: If the NodeType of NodeTable is "Tools" the the SubType of MetaNodeTable will be "Process".
My quwestion is how I can put this validation at the time of data load.Can check constraints work for this?How can I put a constraint for this validation which?
I have to put the validation such a way that it will show the constraint violation if I try to insert any wrong data.....
> Can check constraints work for this?
No, as they check columns in one table.
But, in your example, I see no need to have that data two tables (as NodeId is primary key of both tables).
> I have to put the validation such a way that it will show the constraint violation
Why constraint? Would raising EXCEPTION when wrong data comes satisfy you? I would prefer using it in the stored procedure used for inserting data, however it is possible to use it in a trigger.
You will have to take special care when parallel inserts/updates come into play; you will have to serialize them in both cases.