Re: Check uniqueness of primary key

From: The Baker <walch_at_bigfoot.com>
Date: 7 Aug 1998 08:44:56 GMT
Message-ID: <01bdc1e1$4849f250$9c02d180_at_f8889154>


Hello,

It's not a easy problem.

I think there is two solutions :

  1. use a unique key constraint on the column and wait for the commit to accept or rejet rows. I think it won't be your favorite solution because you want to check the uniqueness before the commit.
  2. The second solution is a 'forms' solution. On the When-validate-item trigger of the primary key field, you have to scan previous records. But you can't use 'previous_record' and 'next_record' functions in this trigger. There's another problem. But there is a solution. You can use a timer : create a timer with a small delay and in the when_timer_expired trigger check your previous records. I have already use this mechanism. It's very fussy solution.

If you need more information, use my e-mail adress.

Regards,
Stephan.

Luc Loodts <luc.loodts_at_alcatel.be> wrote in article <35C9B036.5BBEA761_at_alcatel.be>...
> Hi all,
>
> I have created a tabular form with a column that has the unique key
> property set to TRUE.
> No I am wondering how I can check the uniqueness of the primary key
> value immediately
> after it is entered by the operator (before commit is done).
> I know how to check it against the values that are already in the
> database, but I also want to
> check the uniqueness against the values entered in the form before, but
> still not commited to
> the database.
>
> Many Thanks,
> Luc Loodts.
>
>
>
Received on Fri Aug 07 1998 - 10:44:56 CEST

Original text of this message