
December 8th, 2003, 03:45 PM
|
|
Registered User
|
|
Join Date: Dec 2003
Location: Missouri, USA
Posts: 4
Time spent in forums: 20 m 16 sec
Reputation Power: 0
|
|
procedure data values not displayed in form
I am working in Oracle6i trying to create a form. The form calls a procedure that changes the value of a column in the database. I need this new value displayed in the field on the form. But I am missing some important detail to accomplish this. If I do a requery of the database in the form, the new value shows up. But, I need this new value to be displayed instantly on the form.
In a module component, I have an Action Item that has a WHEN-BUTTON-PRESSED with this event logic code that calls the procedure:
BEGIN
AUTHORIZE_PLANNING_GROUP(:PG_MC.ID);
END;
Then the procedure code is:
CREATE OR REPLACE PROCEDURE AUTHORIZE_PLANNING_GROUP
(p_pg_id IN planning_groups.id%type)
IS
-- local variables for procedure
v_status planning_groups.status%type;
v_products planning_groups.products%type;
BEGIN
IF p_pg_id IS NOT NULL THEN
/* select the status in the PG table that belongs to the current PG being referenced in the application and place in local variable.*/
SELECT status
INTO v_status
FROM planning_groups
WHERE id = p_pig_id;
/* When the planning group has a status of planned, allow the status to be changed to authorized. Set the date to the current date of change. */
IF v_status in ('PLANNED') THEN
UPDATE planning_groups
SET
status = 'AUTHORIZED',
auth_date = sysdate,
date_updated = sysdate
WHERE
id = p_pg_id;
DBMS_OUTPUT.PUT_LINE('A planning group status was updated to authorized.');
ELSE --(Message for when a PG is not in the planned status).
DBMS_OUTPUT.PUT_LINE('A planning group may not be authorized that is not in the PLANNED status.');
END IF;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN RAISE_APPLICATION_ERROR (-20201, 'No data was found.');
COMMIT;
END AUTHORIZE_PLANNING_GROUP;
/
Can anyone tell me what I need to do to get the new value displayed? Thanks much for your help.
|