当前位置:网站首页>数据库高级学习笔记--存储函数
数据库高级学习笔记--存储函数
2022-07-28 09:06:00 【萍果馅是年糕】
--1.存储过程与存储函数的区别
存储函数有return返回值
--2.存储过程与存储函数的关系
存储函数可以与存储过程互换,存储函数可以在存储过程中调用
--3.注意点
如果只有一个返回值,用存储函数,否则,就用存储过程。
--4.存储函数语法
语法:create or replace function(参数 参数类型) return 变量类型 is
begin
代码块;
return 结果变量;
end;
例;创建一个函数,以员工号为参数,返回该员工的工资
create or replace function fun_name101(v_empno in emps.empno%type)
return emps.sal%type is
v_sal emps.sal%type;
begin
select sal into v_sal from emps where empno=v_empno;
return v_sal;
end;
--调用
select fun_name101(7788) from dual;
边栏推荐
- 2022 high voltage electrician examination simulated 100 questions and simulated examination
- MATLAB的符号运算
- 【广西大学】考研初试复试资料分享
- LeetCode - 哈希表专题
- 2022 safety officer-c certificate special operation certificate examination question bank and answers
- Face warp - hand tear code
- The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
- HashSet内部原理解析
- 可以伸缩的搜索栏,模仿华为应用市场
- 这两套代码有什么区别呢?
猜你喜欢

MQTT. JS introductory tutorial: learning notes

QT basic hand training applet - simple calculator design (with source code, analysis)

2022 high voltage electrician examination simulated 100 questions and simulated examination

QT基础练手小程序-简单计算器设计(附带源码,解析)

mysql 最大建议行数2000w,靠谱吗?

脉冲风采|Committer 专访——腾讯工程师张大伟喊你吃“螃蟹”啦

Problems encountered in upgrading golang to version 1.18.4

21 day learning challenge - "AUTOSAR from introduction to mastery - practical part"

《PyTorch深度学习实践》第九课多分类问题(手写数字MNIST)

final关键字和枚举类型
随机推荐
[solution] error in [eslint] eslint is not a constructor
Conditions and procedures of stock index futures account opening
Window源码解析(三):Window的更新机制
With frequent data leakage and deletion events, how should enterprises build a security defense line?
力扣376-摆动序列——贪心
MATLAB的符号运算
ShardingSphere之分库分表概念介绍(二)
C# 之 方法参数传递机制
LeetCode_ 406_ Rebuild the queue based on height
LeetCode(剑指 Offer)- 50. 第一个只出现一次的字符
《PyTorch深度学习实践》第九课多分类问题(手写数字MNIST)
SD卡介绍(基于SPEC3.0)
Heuristic merging on tree
Database core system
[C language] detailed explanation sequence table (seqlist)
[Download] several tools for brute force cracking and dictionary generation are recommended
2022 high voltage electrician examination simulated 100 questions and simulated examination
2.9.5 ext JS object type processing and convenient methods
Introduction to shardingsphere's concept of sub database and sub table (2)
go语言切片Slice和数组Array对比panic runtime error index out of range问题解决