Re: key-commit

From: Daud <daud11_at_hotmail.com>
Date: 8 Oct 2002 12:19:36 -0700
Message-ID: <f0bf3cc3.0210081119.5f07a96e_at_posting.google.com>


What I meant was:
In the database, I created a 'before insert' trigger for a table. Now, in my form I would like to be able to handle any exceptions raise by that trigger if that is possible.
If that is not possible, how else can I do validations in my form just before a record is saved? I am having trouble with all the different triggers in a form.
Not sure which one to use.

thanks & rgds
Daud

"Alan Mills" <Alan.Mills_at_nospamservices.fujitsu.com> wrote in message news:<anu699$npv$1_at_news.icl.se>...
> Your questions aren't that clear but I'll try...
>
> A1 - You will not easily answer this in a Key-Commit trigger. remember that
> the Key-COmmit trigger, assuming it actually performs a COMMIT_FORM will
> cause ALL outstanding DML to be performed and not just an odd single record.
> So if you have an insert and an update on the form, the commit will perform
> both of them.
>
> You could determine at a record by record basis whether you are performing
> an insert or an update inside the key-commit record by navigating to each
> record and testing the record status of each one to determine what you want.
> Questionable though as you are navigating around and will need to return the
> cursor to the same field/item you started out in - non trivial.
>
> One other point here though. KEY-COMMIT will not only act on the block it
> is defined for. It will save ALL data in the entire form. This trigger is
> more normally (although there are good reasons to define them where you've
> got it) defined at the form level rather than at the block level.
>
> A2 - Which row leverl trigger are you talking about? Whichever trigger you
> interested in add an exception handler at the bottom. As long as you
> include a WHEN OTHERS clause you will catch ALL exceptions and can decipher
> and act on them on an individual basis.
>
> Of course the trick to remember ( when youwant it) is to re-raise the
> exception so that calling triggers and procedures will see the error too.
>
> If this isn't what you meant then give more details about which triggers are
> of particular interest and what you want to do with them. and I;ll try to
> be more helpful.
>
> Alan
>
> "Daud" <daud11_at_hotmail.com> wrote in message
> news:f0bf3cc3.0210071424.60d784ed_at_posting.google.com...
> > Q1. From block-level trigger of key-commit, how can I tell if I am
> > trying to commit a new record or an updated record?
> >
> > Q2. If a row-level trigger raises an exception how can I find this out
> > and handle this exception in my form?
> >
> > thanks
> > Daud
Received on Tue Oct 08 2002 - 21:19:36 CEST

Original text of this message