Home » Developer & Programmer » Forms » Commit DML from PL/SQL in Forms 6i
Commit DML from PL/SQL in Forms 6i [message #87402] Wed, 29 December 2004 09:22
Steve
Messages: 190
Registered: September 1999
Senior Member
Hi guys!

I was wondering if anybody has experienced the problem where they cannot update a table via specific DML statements located in a stored PL/SQL trigger (eg, WHEN-BUTTON-PRESSED) When I display the error in Forms Runtime it shows me the DML (which is not the DML I specified in the PL/SQL trigger, but rather the DML it shows is the entire datablock). I do not wish to write the entire datablock, but I need those fields for display purposes. I only wish to update 6 of the fields on the form and write them into the table. This is my stored WHEN-BUTTON-PRESSED trigger:

[
]
BEGIN 

-- This code block writes the updated values to the 'RIDOT.RIDOT_EMP_LEAVE_BALANCES' Table

  UPDATE RIDOT.RIDOT_EMP_LEAVE_BALANCES
  SET vacation_hours = :RIDOT_EMP_LEAVE_BALANCES_V.VAC_HOURS,
  		sick_hours = :RIDOT_EMP_LEAVE_BALANCES_V.SIC_HOURS,
  		deferred_vac_hours = :RIDOT_EMP_LEAVE_BALANCES_V.DEF_HOURS,
  		personal_leave_hours_YTD = :RIDOT_EMP_LEAVE_BALANCES_V.PERS_HOURS,
  		family_sick_hours_YTD = :RIDOT_EMP_LEAVE_BALANCES_V.FAM_HOURS,
  		military_leave_hours_YTD = :RIDOT_EMP_LEAVE_BALANCES_V.MIL_HOURS,
  		last_update_date = :RIDOT_EMP_LEAVE_BALANCES_V.LAST_UPDATE_DATE
  WHERE RIDOT.RIDOT_EMP_LEAVE_BALANCES.EMPLOYEE_SSN = :RIDOT_EMP_LEAVE_BALANCES_V.SSN;
  commit;

-- This code block tells Forms what to display next dependant upon whether the update
-- was successful or not

IF NOT FORM_SUCCESS THEN
	Show_Window('Window_Save_Bad');
	Go_Item('BTN_OK1');
	Hide_Window('WINDOW_CONFIRM');
ELSE
	Show_Window('Window_Save_OK');
	Go_Item('BTN_OK');
	Hide_Window('WINDOW_CONFIRM');
END IF;
END;
[
]

Anything short of redefining the ENTIRE datablock would be greatly appreciated! Thanks!
Previous Topic: Calling DOS from FORMS 10g and printing
Next Topic: Why do i need a Execute_trigger
Goto Forum:
  


Current Time: Thu Sep 19 10:26:42 CDT 2024