本文介绍了Oracle 10G:ORA-06575:功能处于无效状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  CREATE OR REPLACE FUNCTION tax 
(p_sal IN NUMBER(4))
RETURN NUMBER
AS
v_tax NUMBER(4);
BEGIN
v_tax:= CASE
当p_sal> 4000 THEN
p_sal * 0.33
当p_sal> 2500 THEN
p_sal * 0.25
当p_sal> 1500 THEN
p_sal * 0.20
ELSE 0
END;
RETURN v_tax;
END;
/

当我在插入stmt中使用这个税收功能时,就像

  INSERT INTO employees(eno,ename,job,join_date,sal,comm)
VALUES(7784,'allen','salesman', sysdate,5000,tax(5000));

显示错误,例如

 错误:ORA-O6575:包或函数tax处于无效状态。 

任何人都可以告诉我如何让这个函数处于有效状态?
在此先感谢。

解决方案

使用此命令检查错误:

 从user_errors中选择*其中name ='您的函数名称'


I created a funcion like this

CREATE OR REPLACE FUNCTION tax
(p_sal IN  NUMBER(4))
RETURN NUMBER
AS
v_tax NUMBER(4);
BEGIN
v_tax:= CASE
WHEN p_sal> 4000 THEN
p_sal*0.33
WHEN p_sal >2500 THEN
p_sal*0.25
WHEN p_sal >1500 THEN
p_sal*0.20
ELSE 0
END;
RETURN v_tax;
END;
/

when i used this tax function in insert stmt like

INSERT INTO employees(eno, ename, job, join_date, sal, comm)
VALUES (7784,'allen','salesman',sysdate, 5000, tax(5000));

it shows the error like

ERROR: ORA-O6575: package or function tax is in invalid state.

can anyone suggest me how to make this function is in valid state?thanks in advance.

解决方案

Check errors with this command:

Select * from user_errors where name='Your function name'

这篇关于Oracle 10G:ORA-06575:功能处于无效状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 20:06