当前位置:网站首页>数据库高级学习笔记--存储结构
数据库高级学习笔记--存储结构
2022-07-28 09:06:00 【萍果馅是年糕】
--1.什么是存储过程
将一个个PLSQL的业务处理过程存储起来进行复用,这些被存储起来的PLSQL程序称之为存储过程
--2.存储过程的语法
语法:
create or replace procedure 过程名称(参数) is
begin
end;
--3.存储过程注意点
1.过程中没有declare关键字,declare用在语句块中
2.:is和as是可以互用的,用哪个都没关系的
--4.分类
不带参数的 、 带输入参数的 、 带输出参数(返回值)的 、 带输入输出参数(返回值)的
3.1不带参数的
create or replace procedure pro_name101 as
begin
dbms_output.put_line('存储过程复习中');
end;
--调用
begin
pro_name101;
end;
3.2带输入参数的
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;
--调用
begin
pro_name102(10);
end;
3.3带输出参数(返回值)的
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;
--调用
declare
v_ename1 emps.ename%type;
begin
pro_name103(v_ename1);
dbms_output.put_line(v_ename1);
end;
3.4带输入输出参数(返回值)的。
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;
--调用
declare
v_empno1 emps.empno%type;
begin
pro_name104(7788,v_empno1);
dbms_output.put_line(v_empno1);
end;
边栏推荐
- 2.9.5 ext JS object type processing and convenient methods
- Scalable search bar, imitating Huawei application market
- Leetcode - hashtable topic
- Retrofit源码解析
- LeetCode(剑指 Offer)- 50. 第一个只出现一次的字符
- QT基础练手小程序-简单计算器设计(附带源码,解析)
- MQTT.js 入门教程:学习笔记
- 【日志】日志干什么的?日志工厂是什么?log4j 的配置和使用? log4j.properties 文件配置、log4j jar包坐标
- Analysis of HashSet internal principle
- opencv安装配置测试
猜你喜欢

2022 high voltage electrician examination simulated 100 questions and simulated examination

matlab基本操作

IJCAI 2022 | the latest overview of graph structure learning: research progress and future prospects

股指期货开户的条件和流程
![[one flower, one world - Professor Zheng Yi - the way of simplicity] interpretable neural network](/img/fd/8ae7c00061491ad78a0fd68b7c21b0.png)
[one flower, one world - Professor Zheng Yi - the way of simplicity] interpretable neural network
![【解决】ERROR in [eslint] ESLint is not a constructor](/img/58/2ce1243d0085462af3ba6d3da0817d.png)
【解决】ERROR in [eslint] ESLint is not a constructor
![[solution] error in [eslint] eslint is not a constructor](/img/58/2ce1243d0085462af3ba6d3da0817d.png)
[solution] error in [eslint] eslint is not a constructor

Personal blog applet

SQL Server、MySQL主从搭建,EF Core读写分离代码实现

使用Xposed对软件进行破解
随机推荐
LeetCode_ 406_ Rebuild the queue based on height
Analysis of the internal principle of ArrayList
How promise instance solves hell callback
2.9.5 ext JS object type processing and convenient methods
LinkedList内部原理解析
[autosar-rte] - 3-runnable and its task mapping mapping
使用 OpenSSL 创建ssl证书
[JVM] JVM refers to floating point number
mysql 最大建议行数2000w,靠谱吗?
常用工具函数 持续更新
Opencv4.60 installation and configuration
2022 examination question bank and simulation examination of crane driver (limited to bridge crane)
The maximum recommended number of rows for MySQL is 2000W. Is it reliable?
IDC script file running
View的工作原理
MATLAB的数列与极限运算
数据库那么多概念性的东西怎么学?求方法
HashSet内部原理解析
MATLAB的符号运算
会议OA系统