当前位置:网站首页>Database advanced learning notes - storage structure
Database advanced learning notes - storage structure
2022-07-28 11:35:00 【Pingguo stuffed with rice cakes】
--1. What is stored procedure
One by one PLSQL Business processing procedures are stored and reused , These are stored PLSQL Programs are called stored procedures
--2. Syntax of stored procedure
grammar :
create or replace procedure Process name ( Parameters ) is
begin
end;
--3. Notes on stored procedures
1. There was no declare keyword ,declare Used in a statement block
2.:is and as Is interoperable , It doesn't matter which one you use
--4. classification
No parameters 、 With input parameters 、 With output parameters ( Return value ) Of 、 With input and output parameters ( Return value ) Of
3.1 No parameters
create or replace procedure pro_name101 as
begin
dbms_output.put_line(' Stored procedure review ');
end;
-- call
begin
pro_name101;
end;
3.2 With input parameters
create or replace procedure pro_name102(v_deptno in emps.deptno%type) is
v_ename emps.ename%type;
begin
select ename into v_ename from emps where deptno=v_deptno;
dbms_output.put_line(v_ename);
end;
-- call
begin
pro_name102(10);
end;
3.3 With output parameters ( Return value ) Of
create or replace procedure pro_name103(v_ename out emps.ename%type) is
begin
select ename into v_ename from emps where empno=7788;
end;
-- call
declare
v_ename1 emps.ename%type;
begin
pro_name103(v_ename1);
dbms_output.put_line(v_ename1);
end;
3.4 With input and output parameters ( Return value ) Of .
create or replace procedure pro_name104(v_empno in emps.empno%type,v_ename out emps.ename%type) is
begin
select ename into v_ename from emps where empno=v_empno;
end;
-- call
declare
v_empno1 emps.empno%type;
begin
pro_name104(7788,v_empno1);
dbms_output.put_line(v_empno1);
end;
边栏推荐
- Iterative method for determinant (linear algebraic formula)
- 在生产环境中每天Oracle监控到的无效对象一般怎么去处理?
- 开源汇智创未来 | 2022开放原子全球开源峰会OpenAtom openEuler分论坛圆满召开
- Top ten application development trends from 2022 to 2023
- Object to object mapping -automapper
- 用c语言编写学生成绩管理系统(c语言学生成绩管理系统删除)
- 对话庄表伟:开源第一课
- 1天涨粉81W,打造爆款短视频的秘诀是什么?
- Random talk on GIS data (V) - geographic coordinate system
- Ripro9.0 revised and upgraded version +wp two beautification packages + rare plug-ins
猜你喜欢
![Full version of H5 social chat platform source code [complete database + complete document tutorial]](/img/3f/03239c1b4d6906766348d545a4f234.png)
Full version of H5 social chat platform source code [complete database + complete document tutorial]

Boutique scheme | Haitai Fangyuan full stack data security management scheme sets a "security lock" for data

What is the process of switching c read / write files from user mode to kernel mode?

天狼星网络验证源码/官方正版/内附搭建教程

What functions does MySQL have? Don't look everywhere. Just look at this.

接口测试的作用
![[JS advanced] JS functions, overloads, anonymous functions, scopes and scope chains_ 03](/img/50/754f7915ee4b2e04fdd21ae68130c6.png)
[JS advanced] JS functions, overloads, anonymous functions, scopes and scope chains_ 03

What is WordPress

Ten thousand words detailed Google play online application standard package format AAB

融云 IM & RTC 能力上新盘点
随机推荐
How to deal with invalid objects monitored by Oracle every day in the production environment?
Boutique scheme | Haitai Fangyuan full stack data security management scheme sets a "security lock" for data
目标检测领域必看的6篇论文
Object to object mapping -automapper
PKG packaging node project
Cvpr2021 pedestrian re identification /person re identification paper + summary of open source code
1331. Array sequence number conversion
Ripro9.0 revised and upgraded version +wp two beautification packages + rare plug-ins
抖音程序员表白专用代码教程(如何玩抖音)
Outlook suddenly becomes very slow and too laggy. How to solve it
mysql的左连接和右连接(内连接和自然连接的区别)
[JS advanced] JS functions, overloads, anonymous functions, scopes and scope chains_ 03
LiteSpeed Web服务器中安装SSL证书
Jupiter、spyder、Anaconda Prompt 、navigator 快捷键消失的解决办法
PHP detects whether the URL URL link is normally accessible
WPF依赖属性(wpf 依赖属性)
Technology sharing | quick intercom integrated dispatching system
Three methods of using unity mouse to drive objects
What's the secret of creating a popular short video?
ZBrush 2022 software installation package download and installation tutorial