存储函数
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;
/
查询某个员工的年收入
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;
/
相关文章推荐
- 带参数的存储过程
- JAVA设计模式之单例模式
- 关于新建包目录以后,tomcat项目启动报错问题
- c# winform窗体关闭事件
- 敏捷开发
- java碰撞小球
- C++中成员以其在类中声明的顺序构造
- 触发器应用场景
- jdbc连接mysql
- Mac系统安装JavaSE
- ListView事件监听
- iOS小技巧-UITableView禁止上下滑动超出顶部或者底部的内容
- windows下 android jdk sdk环境配置
- Meta http-equiv属性详解
- ThinkPHP之__construct()和__initialize()
- android L新控件RecyclerView详解与DeMo[转]
- iOS网络之多线程
- 配置asp.net 2.0的项目到IIS7
- AsyncTask的简单理解(源码级)
- quickcocos2dx 3.3 拉伸适配