PDA

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


Sam Iam
06-10-2004, 01:02 PM
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
06-10-2004, 04:29 PM
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.

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

Tiago Rocha
06-11-2004, 06:57 AM
On 10 Jun 2004 14:02:04 -0700, thatsamiam@yahoo.com (Sam Iam) wrote:
I often have data blocks where I need to validate columns acrossmultiple rows for situations where like a user must rank items & thereshould 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
06-11-2004, 01:26 PM
Tiago Rocha <please.see.link.at.signature.for.email.address@zaz.com.br> wrote in message news:<mvhjc0l5bvka0i56d98us71rkctfmbvj84@4ax.com>... On 10 Jun 2004 14:02:04 -0700, thatsamiam@yahoo.com (Sam Iam) wrote:I often have data blocks where I need to validate columns acrossmultiple rows for situations where like a user must rank items & thereshould 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
06-11-2004, 01:29 PM
Daniel Morgan <damorgan@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
06-14-2004, 10:32 AM
On 11 Jun 2004 14:26:16 -0700, thatsamiam@yahoo.com (Sam Iam) wrote:

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


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!!!

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


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service