当前位置:网站首页>数据库高级学习笔记--存储函数
数据库高级学习笔记--存储函数
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;
边栏推荐
- go语言切片Slice和数组Array对比panic runtime error index out of range问题解决
- The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
- View的工作原理
- Window源码解析(一):与DecorView的那些事
- matlab基本操作
- MQTT.js 入门教程:学习笔记
- Informatics Olympiad all in one 1617: circle game | 1875: [13noip improvement group] circle game | Luogu p1965 [noip2013 improvement group] circle game
- LeetCode(剑指 Offer)- 50. 第一个只出现一次的字符
- Dn-detr paper accuracy, and analyze its model structure & 2022 CVPR paper
- 2022 safety officer-b certificate examination simulated 100 questions and answers
猜你喜欢
![[package deployment]](/img/6f/93a35436947311bc2305adcb0df1a6.png)
[package deployment]
![376. Swing sequence [greedy, dynamic planning -----]](/img/c3/46cdd8c9320c529171cbf963c768a7.png)
376. Swing sequence [greedy, dynamic planning -----]
![[log] what does a log do? What is a log factory? Configuration and use of log4j? log4j. Properties file configuration, log4j jar package coordinates](/img/ae/096b558bc1342447205b442a244aae.png)
[log] what does a log do? What is a log factory? Configuration and use of log4j? log4j. Properties file configuration, log4j jar package coordinates

对话MySQL之父:代码一次性完成才是优秀程序员

2022 safety officer-c certificate special operation certificate examination question bank and answers

Regular expressions for positive and negative values

Conditions and procedures of stock index futures account opening

网络工程——软科中国大学专业排名

2022 safety officer-b certificate examination simulated 100 questions and answers

Title and answer of work permit for safety management personnel of hazardous chemical business units in 2022
随机推荐
5 operators, expressions, and statements
final关键字和枚举类型
What is it like to use gbase C API to execute stored procedures?
Analysis of HashSet internal principle
ECCV 2022 | can be promoted without fine adjustment! Registration based anomaly detection framework for small samples
Arouter source code analysis (I)
[autosar-rte] - 3-runnable and its task mapping mapping
这两套代码有什么区别呢?
JS array is de duplicated, the ID is the same, and a value is added and merged
ARouter源码解析(一)
C signed and unsigned byte variables
Face warp - hand tear code
【AUTOSAR-RTE】-3-Runnable及其Task Mapping映射
IJCAI 2022 | the latest overview of graph structure learning: research progress and future prospects
MATLAB的符号运算
QT基础练手小程序-简单计算器设计(附带源码,解析)
19c sysaux tablespace sqlobj$plan table is too large. How to clean it up
Conference OA system
[log] what does a log do? What is a log factory? Configuration and use of log4j? log4j. Properties file configuration, log4j jar package coordinates
会议OA系统