Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Oracle Forms 6 : Best way to do multiple row validation ?

768 views
Skip to first unread message

Sam Iam

unread,
Jun 10, 2004, 5:02:04 PM6/10/04
to
I often have data blocks where I need to validate columns across
multiple rows for situations where like a user must rank items & there
should be no gaps & no duplicates.

What's the best place to put this multi-row validation ?

A lot of the validation triggers seem to be row level & so checking
other rows is illegal.

Daniel Morgan

unread,
Jun 10, 2004, 8:29:18 PM6/10/04
to
Sam Iam wrote:

Assuming your design ... I'd put a trigger on any block the user
could move to from that block to validate the entire block before
allowing the move.

--
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damo...@x.washington.edu
(replace 'x' with a 'u' to reply)

Tiago Rocha

unread,
Jun 11, 2004, 10:57:00 AM6/11/04
to
On 10 Jun 2004 14:02:04 -0700, thats...@yahoo.com (Sam Iam) wrote:

>I often have data blocks where I need to validate columns across
>multiple rows for situations where like a user must rank items & there
>should be no gaps & no duplicates.
>
>What's the best place to put this multi-row validation ?

Key-Commit trigger on form level. It allows restricted built-ins. All you need is browse the block
and give an error message if anything is not right or commit if everything's right.

hth
--
Tiago Rocha
Recife - Brasil
www.diariodastrilhas.cjb.net

Sam Iam

unread,
Jun 11, 2004, 5:26:16 PM6/11/04
to
Tiago Rocha <please.see.link.at.sign...@zaz.com.br> wrote in message news:<mvhjc0l5bvka0i56d...@4ax.com>...

> On 10 Jun 2004 14:02:04 -0700, thats...@yahoo.com (Sam Iam) wrote:
>
> >I often have data blocks where I need to validate columns across
> >multiple rows for situations where like a user must rank items & there
> >should be no gaps & no duplicates.
> >
> >What's the best place to put this multi-row validation ?
>
> Key-Commit trigger on form level. It allows restricted built-ins. All you need is browse the block
> and give an error message if anything is not right or commit if everything's right.
>
> hth

Thanks for your reply.

I found a way that's close to what I want using post-forms-commit
trigger but I really want a method that fires as soon as the user
tries to leave a data block where they've entered invalid data.

It sounds like the Key-Commit method you mention would be similar to
post-forms-commit and not fire right after a user leaves the data
block.

Sam Iam

unread,
Jun 11, 2004, 5:29:55 PM6/11/04
to
Daniel Morgan <damo...@x.washington.edu> wrote in message news:<1086913773.206375@yasure>...

> Sam Iam wrote:
>
> > I often have data blocks where I need to validate columns across
> > multiple rows for situations where like a user must rank items & there
> > should be no gaps & no duplicates.
> >
> > What's the best place to put this multi-row validation ?
> >
> > A lot of the validation triggers seem to be row level & so checking
> > other rows is illegal.
>
> Assuming your design ... I'd put a trigger on any block the user
> could move to from that block to validate the entire block before
> allowing the move.

Thanks for your reply.

I found out that the post-forms-commit trigger is a fairly clean place
to do this kind of validation.

The idea seems to be that from there one can use select validations on
Forms copies of table data and then raise an exception to prevent
Forms from commiting those to the actual database.

However I'd prefer a method that does multi-row validation as soon as
the user leaves a data block.

Tiago Rocha

unread,
Jun 14, 2004, 2:32:20 PM6/14/04
to
On 11 Jun 2004 14:26:16 -0700, thats...@yahoo.com (Sam Iam) wrote:


>It sounds like the Key-Commit method you mention would be similar to
>post-forms-commit and not fire right after a user leaves the data
>block.


I did the kind of validation you want on a When-Validate-Record trigger. I don't know if there are
easier ways, but here go the way I did: I created a record group on the when-new-form-instance. On
that form, there are controls to make sure the record group reflects exactly what's in the block,
per example, on the key-clrblk (clear block) trigger, there are code to clear the record group.
Okay, so, when the when-validate-trigger fires, I did a loop through the record group to check if
the data the user is entering conflicts with the data in any row of the record group. If there is
conflict, I show a warning, if not, there goes another row on the record group... You can try this
using a post-block trigger instead of the when-validate-record. Both triggers does not accept
restricted built ins, so you can't do a "first record - loop - exit when system.last_record = true"
thing, but with record groups you can.

hope this helps, good luck!!!

0 new messages