Try to resolve this
smux
Posts: 2
Hello, try to resolve this:
There are a Table, example: TBL_1 whit three fields:
TBL_1
Fld1,
Fld2,
Fld3
How to introduce a constraint that do that one and only one of the fields have got data,
the other fields have to be empty.
Ex correct:
TBL_1 --> NULL,NULL,1
NULL,1,NULL
1,NULL,NULL
Ex incorrect (this haven't to happened):
TBL_1 --> 1,1,NULL
1,1,1
NULL,NULL,NULL
There are a Table, example: TBL_1 whit three fields:
TBL_1
Fld1,
Fld2,
Fld3
How to introduce a constraint that do that one and only one of the fields have got data,
the other fields have to be empty.
Ex correct:
TBL_1 --> NULL,NULL,1
NULL,1,NULL
1,NULL,NULL
Ex incorrect (this haven't to happened):
TBL_1 --> 1,1,NULL
1,1,1
NULL,NULL,NULL
This discussion has been closed.
Comments
You'd more than likely have to program this into the logic of the application that's inserting the data, something like
If Fld1!=NULL XOR Fld2!=NULL XOR Fld3!=NULL Then...