Re: Need trigger for form.

From: M Hamilton <mhamilton_at_usgs.gov>
Date: 21 Nov 2003 14:57:48 -0800
Message-ID: <7ce65461.0311211457.45f180f5_at_posting.google.com>


[Quoted] Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1069438133.846471_at_yasure>...
> M Hamilton wrote:
> > Come on now, someone out there knows how to do this. I just know it.
> > There's got to be a Forms expert that can help me out.
> >
> > How about Daniel Morgan? He seems to know alot and participates in
> > this forum a bunch with innovative solutions.
> >
> > Help, pleezz.
> > MH
>
> Didn't notice your original post and can't get it back ... please repost.

[Quoted] You bet, be glad to.

In Designer6i I have created a form that has an action item (button) that when pressed calls the CANCEL procedure. The CANCEL procedure changes the value of a database column (STATUS_CODE) from 'AUTHORIZED' to 'CANCELED'. What trigger can I use at the block level that will update the block on the form and display the new value in the field?

I tried using POST-UPDATE with this code: BEGIN
    select status_code
    into :it_gdaps_mc.status_code
    from items_gdaps
    where rowid = :it_gdaps_mc.rowid;
END; It did not requery the database and display the new values that were set by the CANCEL procedure.

This is the code for my procedure:

CREATE OR REPLACE PROCEDURE cancel
(p_id IN planning_groups.id%type)
IS
BEGIN UPDATE items_gdaps
SET
items_gdaps.status_code = 'CANCELED'
WHERE
items_gdaps.pg_id = p_id
AND items_gdaps.status_code = 'AUTHORIZED';

COMMIT; EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR
(-20201, 'No data was found.');

END cancel;
/

Thank you for taking a look at this.
MH Received on Fri Nov 21 2003 - 23:57:48 CET

Original text of this message