create or replace trigger XX_WIP_QTY_CEIL_round
before insert or update on WIP_REQUIREMENT_OPERATIONS
referencing new as new old as old
for each row
when (NEW.quantity_issued = 0 and NEW.operation_seq_num > 0 and new.required_quantity is not null)
declare
l_start_qty number;
l_uom_flag varchar2(100); --判断是否为数量单位
uom_code varchar2(5);
begin
select count('X'),primary_uom_code
into l_uom_flag,uom_code
from mtl_system_items_b
where inventory_item_id = :new.inventory_item_id
and organization_id = :new.organization_id
and primary_uom_code in ('PCS', 'EA','KG');
if (l_uom_flag = 1 ) then
if uom_code in ('PCS','EA') then
begin
select nvl(start_quantity, 0)
into l_start_qty
from wip_discrete_jobs
where organization_id = :new.organization_id
and wip_entity_id = :new.wip_entity_id;
exception
when others then
null;
end;
:new.required_quantity := ceil(:new.required_quantity);
if l_start_qty != 0 then :new.quantity_per_assembly := ceil(:new.required_quantity)/
l_start_qty;
end if;
elsif ( uom_code='KG') then
begin
select nvl(start_quantity, 0)
into l_start_qty
from wip_discrete_jobs
where organization_id = :new.organization_id
and wip_entity_id = :new.wip_entity_id;
exception
when others then
null;
end;
:new.required_quantity := round(:new.required_quantity,3);
if l_start_qty != 0 then :new.quantity_per_assembly := round(:new.required_quantity,3) /
l_start_qty;
end if;
end if;
if :new.mrp_net_flag = 1 then
:new.mps_required_quantity := :new.required_quantity;
end if;
end if;
end;ORA-06512:在"APPS.XX_WIP_QTY_CEIL_ROUND",LINE 6
ORA-04088:触发器"APPS.XX_WIP_QTY_CEIL_ROUND"执行过程中出错我的触发器要怎么修改呢。
before insert or update on WIP_REQUIREMENT_OPERATIONS
referencing new as new old as old
for each row
when (NEW.quantity_issued = 0 and NEW.operation_seq_num > 0 and new.required_quantity is not null)
declare
l_start_qty number;
l_uom_flag varchar2(100); --判断是否为数量单位
uom_code varchar2(5);
begin
select count('X'),primary_uom_code
into l_uom_flag,uom_code
from mtl_system_items_b
where inventory_item_id = :new.inventory_item_id
and organization_id = :new.organization_id
and primary_uom_code in ('PCS', 'EA','KG');
if (l_uom_flag = 1 ) then
if uom_code in ('PCS','EA') then
begin
select nvl(start_quantity, 0)
into l_start_qty
from wip_discrete_jobs
where organization_id = :new.organization_id
and wip_entity_id = :new.wip_entity_id;
exception
when others then
null;
end;
:new.required_quantity := ceil(:new.required_quantity);
if l_start_qty != 0 then :new.quantity_per_assembly := ceil(:new.required_quantity)/
l_start_qty;
end if;
elsif ( uom_code='KG') then
begin
select nvl(start_quantity, 0)
into l_start_qty
from wip_discrete_jobs
where organization_id = :new.organization_id
and wip_entity_id = :new.wip_entity_id;
exception
when others then
null;
end;
:new.required_quantity := round(:new.required_quantity,3);
if l_start_qty != 0 then :new.quantity_per_assembly := round(:new.required_quantity,3) /
l_start_qty;
end if;
end if;
if :new.mrp_net_flag = 1 then
:new.mps_required_quantity := :new.required_quantity;
end if;
end if;
end;ORA-06512:在"APPS.XX_WIP_QTY_CEIL_ROUND",LINE 6
ORA-04088:触发器"APPS.XX_WIP_QTY_CEIL_ROUND"执行过程中出错我的触发器要怎么修改呢。
解决方案 »
- 电信项目的一个存储过程sql语句,求大神指导。。。。。。。。。。。。。。。。
- 谁能帮忙优化一下这个sql查询语句,谢谢!
- PL/SQL 的问题
- 用什么工具怎么样去断掉连接ORACLE数据库服务器的用户?
- 数据导出时遇到的问题
- 锁定
- 问个极简单问题但我总感觉很模糊??
- 如何在SQL PLUS里面输出用“|”“--”分割出来的表格形式?
- 有关svrmgrl的问题,急
- 创建包体的时候报错PLS-00103,请教大家应该怎么处理
- 在注册表编辑器里找不到putty
- vmware infrastructure client出现failed to power on:A general system error occurred
我觉得你还是一截一截的调试,不要把所有的功能多写全了再调试,
等第一个功能完成了,然后再一点一点的添加...