您的位置:首页 > 其它

存储函数

2015-11-10 13:57 253 查看
/*

查询某个员工的年收入

CREATE [OR REPLACE] FUNCTION 函数名(参数列表)

RETURN 函数值类型

AS

PLSQL子程序体;

*/

create or replace function queryEmpIncome(eno in number)

return number

as

–变量

psal emp.sal%type;

pcomm emp.comm%type;

begin

select sal,comm into psal,pcomm from emp where empno=eno;

return psal*12+nvl(pcomm,0);

end;

/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: