简体   繁体   English

Oracle 触发器调用存储过程

[英]Oracle trigger to call Stored Procedure

I have an SP that needs to be called by an "after update" trigger.我有一个需要由“更新后”触发器调用的 SP。 This Sp writes out a document to the mounted oracle directory for the host application to pick up.该 Sp 将一个文档写入已挂载的 oracle 目录,供主机应用程序获取。 The SP has the following parameters: SP 具有以下参数:

CREATE OR REPLACE test_sp_mbinfo
(out_status OUT VARCHAR2,
out_dir OUT VARCHAR2,
in_contract IN VARCHAR2)

The in_contract parameter would be sent in by the triggering event. in_contract 参数将由触发事件发送。 The trigger code i have so far that i have a hard time compiling is:到目前为止,我很难编译的触发代码是:

CREATE OR REPLACE TRIGGER mbinfo_trig
AFTER UPDATE OF tsta_cncontst ON kndtsta
FOR EACH ROW

BEGIN

IF (:new.tsta_cncontst IN ('02','06'))
THEN
 test_sp_mbinfo(:new.tsta_cncclipu);
END IF;

END
;

How do i pass in the 2 out parameters to make the process work?我如何传入 2 个输出参数以使该过程正常工作?

Thank you!谢谢!

You could declare two local variables in the trigger and pass those for the OUT parameter.您可以在触发器中声明两个局部变量并将它们传递给OUT参数。 The question then becomes whether you care about the returned values, and if so what to do with them.然后问题就变成了您是否关心返回的值,如果关心,如何处理它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM