How could I define referential integrity using FK constraint which allow me to have empty string/ZERO number instead of NULL value ?
Thank you
If you place a foreign key constraint on a column, zero is only a valid value if there is a zero in foreign key table. The same applies to empty strings.
If the foreign key value of a particular row is unknown (or it doesnt have one), that's where the use of null comes in. Of course a NOT NULL constraint used in conjunction with the FK constraint can prevent the use of nulls (forcing a valid FK value).
To the best of my knowledge, it's not possible to change this behavior.
No comments:
Post a Comment