如何在触发器中调用 PL/SQL 函数
我是 pl/sql 新手。谁能告诉我如何在触发器内调用 pl/sql 函数。
我厌倦了它,但当我尝试运行它时它给出了错误。
DROP TRIGGER INTF_CONTROLLER_TREXE;
CREATE OR REPLACE TRIGGER INTF_CONTROLLER_TREXE
before insert ON INTF_CONTROLLER for each row
begin
BACKOFFICE_UPDATE();
end;
CREATE OR REPLACE FUNCTION BACKOFFICE_UPDATE
RETURN NUMBER IS
tmpVar NUMBER;
BEGIN
tmpVar := 0;
DBMS_OUTPUT.put_line ('HELLO');
RETURN tmpVar;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END BACKOFFICE_UPDATE;
我尝试使用 TOAD 来运行它。它给出以下错误
PLS-00221:“BACKOFFICE_UPDATE”不是过程或未定义
I am new to pl/sql. can any one tell me how to call pl/sql function inside a trigger.
I tired it but it gives an error when i try to run it.
DROP TRIGGER INTF_CONTROLLER_TREXE;
CREATE OR REPLACE TRIGGER INTF_CONTROLLER_TREXE
before insert ON INTF_CONTROLLER for each row
begin
BACKOFFICE_UPDATE();
end;
CREATE OR REPLACE FUNCTION BACKOFFICE_UPDATE
RETURN NUMBER IS
tmpVar NUMBER;
BEGIN
tmpVar := 0;
DBMS_OUTPUT.put_line ('HELLO');
RETURN tmpVar;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END BACKOFFICE_UPDATE;
I tried to run it using TOAD. it gives the following error
PLS-00221: 'BACKOFFICE_UPDATE' is not a procedure or is undefined
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将函数调用的结果存储在局部变量中
You need to store the result of your function call in a local variable