Re: Tough data validation problem

From: Steve Bell <swayne.bell_at_sympatico.ca>
Date: Fri, 16 Mar 2001 13:52:48 GMT
Message-ID: <3AB218BC.7A3B086F_at_sympatico.ca>


Hi Chris,
It's been a very long time since I've worked with Forms. As I recall though, can't you validate at the block level (instead of the item level as you're attempting?)
Perhaps a trigger similar to what you're discussing would work if you place it one level up the hierarchy.

I hope this is of some help.
Steve

Chris Fischer wrote:

> Hello, I've got a unique data validation requirement.
>
> I've got two tables MASTER and DETAIL.
>
> One of the columns in DETAIL is PRIMARY_FLAG.
>
> In my form, which is a typical master detail form, the user can enter
> a MASTER with one or more DETAILs. They must enter a value for the
> PRIMARY_FLAG. Allowed values are 'Y' and 'N'. One and only one
> detail must have a 'Y' the rest must have 'N'.
>
> How/where can I enforce this? I can't write a DB trigger because
> AFTER INSERT will fire for each one. I can't do it in PRE-INSERT on
> the DETAIL block because a later one may have the 'Y' set. I can't do
> it in PRE/POST insert on the MASTER block, because the MASTER might
> have been inserted previously and the operator is only coming back to
> create DETAILS.
>
> Any ideas??
>
> TIA.
>
> chris PERIOD fischer AT itron d.o.t com
Received on Fri Mar 16 2001 - 14:52:48 CET

Original text of this message