Re: key-commit

From: Alan Mills <Alan.Mills_at_nospamservices.fujitsu.com>
Date: Tue, 8 Oct 2002 09:50:49 +0100
Message-ID: <anu699$npv$1_at_news.icl.se>


[Quoted] 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 - 10:50:49 CEST

Original text of this message