aonestar
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_trg_department_before_update
Parameters
Name
Type
Mode
Definition
DECLARE target_id INT; v_table_name text; begin -- === create by T.Supol 2025-06-26 if fn_sys_param('DEPOSIT','DEFAULT_PAYMENT_ID',null::int4) = old.id then if new.enabled = false then -- raise exception 'can not update [%]', v_table_name ; raise exception 'Cannot delete, % is being used in some transactions.', old.name; end if; return new; end if; -- -- -- if fn_sys_param('DEPOSIT','NOSHOW_DEPT_ID',null::int4) = old.id then -- if new.enabled = false then -- -- raise exception 'can not update [%]', v_table_name ; -- raise exception 'Cannot delete, % is being used in some transactions.', old.name; -- end if; -- -- return new; -- end if; -- -- if fn_sys_param('DEPOSIT','CANCEL_DEPT_ID',null::int4) = old.id then -- if new.enabled = false then -- -- raise exception 'can not update [%]', v_table_name ; -- raise exception 'Cannot delete, % is being used in some transactions.', old.name; -- end if; -- -- return new; -- end if; -- if fn_sys_param('DEPOSIT','REFUND_PAYMENT_ID',null::int4) = old.id then if new.enabled = false then -- raise exception 'can not update [%]', v_table_name ; raise exception 'Cannot delete, % is being used in some transactions.', old.name; end if; return new; end if; -- -- -- -- if fn_sys_param('AUTO_POST','ROOM',null::int4) = old.id then -- if new.enabled = false then -- -- raise exception 'can not update [%]', v_table_name ; -- raise exception 'Cannot delete, % is being used in some transactions.', old.name; -- end if; -- -- return new; -- end if; -- -- if fn_sys_param('AUTO_POST','ABF',null::int4) = old.id then -- if new.enabled = false then -- -- raise exception 'can not update [%]', v_table_name ; -- raise exception 'Cannot delete, % is being used in some transactions.', old.name; -- end if; -- -- return new; -- end if; -- -- if fn_sys_param('AUTO_POST','LUNCH',null::int4) = old.id then -- if new.enabled = false then -- -- raise exception 'can not update [%]', v_table_name ; -- raise exception 'Cannot delete, % is being used in some transactions.', old.name; -- end if; -- -- return new; -- end if; -- -- if fn_sys_param('AUTO_POST','DINNER',null::int4) = old.id then -- if new.enabled = false then -- -- raise exception 'can not update [%]', v_table_name ; -- raise exception 'Cannot delete, % is being used in some transactions.', old.name; -- end if; -- -- return new; -- else -- return new; -- end if; return new; END;