当前位置:网站首页>Database advanced learning notes -- storage functions
Database advanced learning notes -- storage functions
2022-07-28 09:51:00 【Pingguo stuffed with rice cakes】
--1. The difference between stored procedure and stored function
Storage functions have return Return value
--2. The relationship between stored procedures and stored functions
Stored functions can be interchanged with stored procedures , The storage function can be called in stored procedure.
--3. Be careful
If there is only one return value , With storage functions , otherwise , Just use stored procedures .
--4. Storage function syntax
grammar :create or replace function( Parameters Parameter type ) return Variable type is
begin
Code block ;
return Outcome variable ;
end;
example ; Create a function , Take employee number as parameter , Return the salary of the employee
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;
-- call
select fun_name101(7788) from dual;
边栏推荐
猜你喜欢

SQL server, MySQL master-slave construction, EF core read-write separation code implementation

在Plato Farm新经济模型下,如何在游戏中获取更多MARK

3分钟告诉你如何成为一名黑客|零基础到黑客入门指南,你只需要掌握这五点能力
C form application uses object binding DataGridView data binding

Introduction to SD card (based on spec3.0)

【日志】日志干什么的?日志工厂是什么?log4j 的配置和使用? log4j.properties 文件配置、log4j jar包坐标

老板:公司系统太多,能不能实现账号互通?

3 minutes to tell you how to become a hacker | zero foundation to hacker getting started guide, you only need to master these five abilities

Some problems about CLR GC tuning

SQL Server、MySQL主从搭建,EF Core读写分离代码实现
随机推荐
Common tool functions are constantly updated
FixedWindowRollingPolicy简介说明
2022-7-27周报
超级原始人系列盲盒即将上线,PlatoFarm赋能超多权益
初学C#必须要掌握的基础例题
OSS直连上传-Rails服务实践
Arouter source code analysis (II)
使用 OpenSSL 创建ssl证书
Symbolic operation of MATLAB
Go language slice vs array panic runtime error index out of range problem solving
Analysis of the internal principle of ArrayList
JS提升:实现flat平铺的底层原理
Introduction to shardingsphere's concept of sub database and sub table (2)
DAO社区的胜利,Tiger DAO VC胜在治理与共识
对象到对象映射-AutoMapper
Arouter source code analysis (III)
就这么一个简单的校验,80%的程序员却做不到,更不理解!
总线相关概念集合
SizeBasedTriggeringPolicy简介说明
ARouter源码解析(二)