当前位置:网站首页>Stored procedure test 1 -- first acquaintance of love
Stored procedure test 1 -- first acquaintance of love
2022-07-27 08:02:00 【Shenzhi Kalan Temple】
##### Write it at the front , Stored procedure is a relatively old sql The language , At present, there are many information about this on the Internet , I also rely on them to learn ( After all, I can reach this level Of , Generally speaking, it takes only two hours to learn a new language ),##### Due to insufficient time precipitation , There are inevitably omissions and mistakes , Therefore, this series of stored procedure articles is not for popularization , Just for my own notes
##### finger heart , Finally bow to the stored procedure
I have been doing big data for many years , I hate stored procedures , Because it is difficult to migrate , The reproducibility is not high , Difficult to develop , There are no clusters and other bad points . But it's a mistake , The project I'm working on now just needs Oracle To realize the calculation and loading of data , Both good and bad things have , There is only a distinction between fit and unfitness , So review the stored procedure , I found that he still has the following advantages ( It has nothing to do with what I have to do now , Yes , I am sincere !)
1. Fast execution —— Stored procedures are compiled only at creation time , Every time you execute a stored procedure in the future, you don't need to recompile
2. Reduce network traffic —— When doing complex operations on a database , For example, for multiple tables insert、update Transactions can be run together in batches
3. Improve reusability —— Stored procedures can be reused , Improved reusability
4. High maintainability —— Updating stored procedures is usually better than changing 、 Testing and redeploying assemblies takes less time and effort .
5. High safety and reliability —— The authority mechanism of the database itself determines its security
What about stored procedures ?
To put it simply, put more insert etc. DML,drop etc. DDL A precompiled collection of statements executed together , Similar to function , But there is also meaning , Way of execution , The use conditions are different , For example, a stored procedure can call and reference other stored procedures , But functions can only reference other return sets .
That's the definition , Now let's write a simplest stored procedure , It's what we often use hello world
-- Create stored procedures
CREATE OR REPLACE PROCEDURE testMyProcedure AS
BEGIN
DBMS_OUTPUT.put_line('Hello World');
END;
-- Run stored procedures , It can also be EXECUTE testMyProcedure;
BEGIN
testMyProcedure;
END;Can pass sqlplus Login execution execute xxx To run the , It can also be in IDE such as pl/sql developer Running in begin xxx; end;
OK, This is the end of the first acquaintance , In the next article, we will introduce the basic architecture by building test tables and testing stored procedures https://mochou.blog.csdn.net/article/details/116612107
边栏推荐
- 将对象转换为键值对
- Bash: sudo: command not found in container
- [pytorch] resnet18, resnet20, resnet34, resnet50 network structure and Implementation
- 【已解决】新版Pycharm(2022)连接服务器进行上传文件报错“Command rsync is not found in PATH”,无法同步文件
- Shell scripts related
- 这次龙蜥展区玩的新花样,看看是谁的 DNA 动了?
- C language: optimized Hill sort
- Gossip: it's really important to have a rod in your hand and a net on your shoulder. As for how many fish are in the basket?
- What is a rebound shell? What's the use of bouncing shells?
- 综合案例、
猜你喜欢

一文速览EMNLP 2020中的Transformer量化论文

2020国际机器翻译大赛:火山翻译力夺五项冠军

【小程序】uniapp发行微信小程序上传失败Error: Error: {'errCode':-10008,'errMsg':'invalid ip...

Gossip: it's really important to have a rod in your hand and a net on your shoulder. As for how many fish are in the basket?
![API version control [eolink translation]](/img/3a/8a78e57a2474f33d011d91631fde74.jpg)
API version control [eolink translation]

北京五日游记

API 版本控制【 Eolink 翻译】

Stored procedures and functions

Installation and use of apifox

Zero training platform course-1. SQL injection Foundation
随机推荐
抽象工厂模式
glGetUniformLocation,glUniform4f
Redison 3.17.5 release, officially recommended redis client
数据库启动报error_user_connect_times > 0错误
Lua iterator
代码接口自动化的有点
3D激光SLAM:LeGO-LOAM论文解读---摘要
Digital transformation driven by enterprise architecture!
mqtt指令收发请求订阅
CommonTitleBar hide left right
The code interface is a little automated
C language: random number + Hill sort
How to obtain the cash flow data of advertising services to help analyze the advertising effect?
[flight control development foundation tutorial 4] crazy shell · open source formation UAV - serial port (optical flow data acquisition)
杂谈:把肉都烂在锅里就是保障学生权益了?
Bash: sudo: command not found in container
Qt Creator代码风格插件Beautifier
MySQL table name area in Linux is not case sensitive
【Golang】golang开发微信公众号网页授权功能
Want the clouds in the picture to float? Video editing services can be achieved in three steps with one click