Re: Checking for duplicate items, Forms4.5

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Sun, 9 May 1999 19:45:01 +0100
Message-ID: <dc4VFRAtedN3Ewfb_at_ahardy.demon.co.uk>


In article <7h14ql$j6q$1_at_news8.svr.pol.co.uk>, Simon Hedges <shedges_at_hhhh.freeserve.co.uk> writes
>
>Andy Hardy wrote in message ...
>>In article <7gt0nk$smv$1_at_news5.svr.pol.co.uk>, Simon Hedges
>><shedges_at_hhhh.freeserve.co.uk> writes
>>>You should be able to check the data in the Database as follows
>>>
>>>select MYTABLE.MYTEXT from MYTABLE where MYTABLE.MYTEXT =
>>>:MYBLOCK.MYTEXT and :MYTABLE.MYKEY <> :MYBLOCK.MYKEY
>>>
>>>This will return any row which exactly matches the current text from the
>DB,
>>>EXCEPT for the current row.
>>
>>Oh dear, sometimes I just look for the hardest way to do these things!
>>Thanks!
>>
>>Can you confirm that Forms does nothing itself to check for uniqueness,
>>and that if I relied on the normal response I'd just get the 'cannot
>>INSERT' message with no indication of the field causing the problem?
>>
>>Andy
>
>
[snip]
>There is something in forms (a property on either the block or item - can't
>remember which) which will check for the uniqueness of a primary key (I'm
>not sure about Unique Key), but for some reason Oracle state that you should
>avoid this this as it is a big overhead.

Setting 'primary key' seems to tell Forms to check for uniqueness, but it also prevents that field being changed in the future - not quite what I want.

>Incidentally, my proposed solution will work when the user commits each row
>each time they move to a new record, but if user creates, say, 3 identical

Yes, it does all start to become quite hideous! I think that I shall be forcing validation for each record and not validating the individual fields until then - I think that it's better for the user to be told that 'X, Y, Z' are incorrect rather than 'X' when they move from that field.

>If your Form is generated from Designer, it probably will have code which
>checks for uniqueness, but this will depend on the template form used, and
>the various generation settings.

I didn't use Designer, but I might try a quick dummy screen just to see what it does!

-- 
Andy Hardy. PGP key available on request
===============================================================
Received on Sun May 09 1999 - 20:45:01 CEST

Original text of this message