当前位置:网站首页>Traversal of Oracle stored procedures
Traversal of Oracle stored procedures
2022-07-07 20:10:00 【Jianghu crab】
The following content mainly introduces Oracle Stored procedure , How to use for Loop through the spliced SQL sentence , And implement .
- The cycle of writing
notes : For the sake of brevity , In the following code block “SQL sentence ” Of SQL It will be shown below .
FOR ARR IN (SQL sentence ) LOOP
-- Console printing ( During the official run , It is suggested to delete or comment )
DBMS_OUTPUT.PUT_LINE(ARR.SS);
-- perform sql
EXECUTE IMMEDIATE ARR.SS;
END LOOP;
Don't tangle with the following statement , Just see what you like . Mainly to express the final implementation SQL How did you get it .( Splicing sql You cannot add a semicolon at the end of a statement , Otherwise execution sql Will make mistakes )
SELECT 'UPDATE SCHOOL_ROll SET ROLL = '|| S.ROLL || 'WHERE ID = ' || S.ID FROM STUDNETS AS S
- Complete stored procedure statements
CREATE
OR REPLACE PROCEDURE "SP_OA_SL" AS BEGIN
-- Traverse SQL Execution results
FOR ARR IN ( SQL sentence ) LOOP
-- Console printing ( During the official run , It is suggested to delete or comment )
DBMS_OUTPUT.PUT_LINE ( ARR.SS );
-- perform sql
EXECUTE IMMEDIATE ARR.SS;
END LOOP;
END;
边栏推荐
猜你喜欢
School 1 of vulnhub
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
Simulate the implementation of string class
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
9 atomic operation class 18 Rohan enhancement
力扣 2319. 判断矩阵是否是一个 X 矩阵
使用高斯Redis实现二级索引
mysql 的一些重要知识
LeetCode_7_5
干货分享|DevExpress v22.1原版帮助文档下载集合
随机推荐
Force buckle 1961 Check whether the string is an array prefix
Ways to improve the utilization of openeuler resources 01: Introduction
编译器优化那些事儿(4):归纳变量
力扣599. 两个列表的最小索引总和
关于自身的一些安排
The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
力扣674. 最长连续递增序列
Navicat连接2002 - Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘解决
pom. XML configuration file label: differences between dependencies and dependencymanagement
torch.nn.functional.pad(input, pad, mode=‘constant‘, value=None)记录
搞定带WebKitFormBoundary post登录
PMP practice once a day | don't get lost in the exam -7.7
力扣 2319. 判断矩阵是否是一个 X 矩阵
pom.xml 配置文件标签:dependencies 和 dependencyManagement 区别
Graduation season | regretful and lucky graduation season
Nunjuks template engine
论文解读(ValidUtil)《Rethinking the Setting of Semi-supervised Learning on Graphs》
pom. Brief introduction of XML configuration file label function
Implement secondary index with Gaussian redis