|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
现因业务需要,在工单入库时要对移动加权平均成本重新计算,经查,oracle本身提供了一个扩展可以做客户化。
-- FUNCTION
-- actual_cost_hook Cover routine to allow users to add
-- customization. This would let users circumvent
-- our transaction cost processing. This function
-- is called by both CSTPACIN and CSTPACWP.
--
--
-- RETURN VALUES
-- integer 1 Hook has been used.
-- 0 Continue cost processing for this transaction
-- as usual.
--
function actual_cost_hook(
I_ORG_ID IN NUMBER,
I_TXN_ID IN NUMBER,
I_LAYER_ID IN NUMBER,
I_COST_TYPE IN NUMBER,
I_COST_METHOD IN NUMBER,
I_USER_ID IN NUMBER,
I_LOGIN_ID IN NUMBER,
I_REQ_ID IN NUMBER,
I_PRG_APPL_ID IN NUMBER,
I_PRG_ID IN NUMBER,
O_Err_Num OUT NOCOPY NUMBER,
O_Err_Code OUT NOCOPY VARCHAR2,
O_Err_Msg OUT NOCOPY VARCHAR2
)
return integer IS
BEGIN
o_err_num := 0;
o_err_code := '';
o_err_msg := '';
return 0;
EXCEPTION
when others then
o_err_num := SQLCODE;
o_err_msg := 'CSTPACHK.ACTUAL_COST_HOOK:' || substrb(SQLERRM,1,150);
return 0;
END actual_cost_hook;
可是,具体要如何实现,还是不很明白,望知道的高人指点一二,多谢了。 |
|