-2
为什么我在这里收到编译错误?表中所有属性的名称都是正确的。此外,该表存在。“编译错误”与功能
SQL> create or replace function user_annual_comp(f_eno emp1.empno%type) return number
2 is
3 f_sal emp1.salary%type;
4 f_comm emp1.comm%type;
5 annual_comm number;
6 begin
7 select salary into f_sal from emp1 where empno = f_eno;
8 select comm into f_comm from emp1 where empno = f_eno;
9 if f_sal is null then
10 f_sal := 0;
11 end if;
12 if f_comm is null then
13 f_comm := 0;
14 end if;
15 annual_comm = (f_sal + f_comm) * 12;
16 return annual_comm;
17 end;
18/
结果:
Warning: Function created with compilation errors.
我该如何解决这个问题?
没有关于错误信息的更多具体信息?哪条线? – Juru 2014-10-05 07:48:02
什么'show error'给你? – 2014-10-05 15:31:19
希望OP在'SQL * Plus'中编译函数:-) – 2014-10-05 16:06:02