Try to resolve this

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
smux
Posts: 1
Joined: Thu 08 Sep 2005 09:05

Try to resolve this

Post by smux » Thu 08 Sep 2005 09:06

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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 08 Sep 2005 14:40

You can get this functionality on client side by using TDataSet.BeforePost event or on server side by using triggers

Post Reply