This trigger is not updating a HAZ_MATERIAL field in an item master table (and it should be updating it). After I update the item master record, or delete and recreate it, the HAZ_MATERIAL field is still null.
I can run the query with the item number hard-coded into it, and Oracle returns a '1', so I'm fairly sure the query is working. Nevertheless, I haven't written a ton of triggers, so this could be something completely trivial.
create or replace
trigger tr_item_master_hazmat
before insert or update on t_item_master
for each row
declare
isHazmat char(1);
begin
isHazmat := '0';
select '1'
into isHazmat
from t_item_master itm
inner join v_item_dcl_supplier ora
on ora.inventory_item_id = itm.oracle_inventory_item_id
inner join spwh_hazmat_dcl haz
on haz.dept = ora.dept
and haz.class = ora.class
and haz.line = ora.line
where itm.item_number = :new.item_number;
if isHazmat = '1'
then
:new.haz_material := '1';
end if;
exception
when no_data_found
then
null;
when others
then
null;
end tr_item_master_hazmat;
Thanks for your time and assistance.