Re: Checking for duplicate items, Forms4.5

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Mon, 10 May 1999 18:38:00 +0100
Message-ID: <L56qUDA4lxN3Ew$o_at_ahardy.demon.co.uk>


[Quoted] In article <7h21iv$gog$1_at_nntp.csufresno.edu>, Steve Cosner <stevec_at_zimmer.csufresno.edu> writes
>I have recently worked on the problem of looking for duplicates in a
>form. Using an on-error trigger and a database constraint made the
>solution pretty easy.
>
>First in the key-commit process, I did a Post command, followed by
>checking: If not form_success or :system.form_status<>'QUERY' then
>Raise Form_trigger_failure; This terminated the commit processing if
>an insert or update failed due to a duplicate key. If there were no
>duplicate key problems, the process continued to a commit_form.
>
>Using commit_form instead of post would probably work as well, now
>that I think about it.

That's close to what I want, but I'd like to tell the user which items are invalid for the record with a meaningful message. e.g. 'A is mandatory, B is a duplicate for X'. I do this with a procedure that checks each field of the current record and writes errors into a record group.

[Quoted] I've removed item validation and am trying to do the validation at a per-record level. The duplicate checking is a pain... if I follow the approach that you outlined then I seem to loose the individual record messaging and end up with a 'Record has a duplicate field, somewhere'.

[Quoted] It feels like I should have a POST-RECORD trigger to do the validation, and if it is successful then POST the current record. Unfortunately, POST is a restricted function...

[Quoted] I'm not sure what your POST call is gaining in the KEY-COMMIT. At this point, the user has already decided to commit and normal processing would raise the duplicates errors?

[Quoted] [Quoted] Bother... perhaps I'm trying to be too clever and should just try and track the errors produced by Oracle during it's normal processing! But I would like to get away from item level validation...

-- 
Andy Hardy. PGP key available on request
===============================================================
Received on Mon May 10 1999 - 19:38:00 CEST

Original text of this message