当前位置:网站首页>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;
边栏推荐
猜你喜欢

【STL】vector

The project manager's "eight interview questions" is equal to a meeting

Vulnhub tre1

Openeuler prize catching activities, to participate in?

Force buckle 2319 Judge whether the matrix is an X matrix

8 CAS

Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse

Cloud component development and upgrading

【哲思与实战】程序设计之道
![About cv2 dnn. Readnetfromonnx (path) reports error during processing node with 3 inputs and 1 outputs [exclusive release]](/img/59/33381b8d45401607736f05907ee381.png)
About cv2 dnn. Readnetfromonnx (path) reports error during processing node with 3 inputs and 1 outputs [exclusive release]
随机推荐
Make this crmeb single merchant wechat mall system popular, so easy to use!
力扣 1037.有效的回旋镖
Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!
CUDA versions are inconsistent, and errors are reported when compiling apex
Detailed explanation of Flink parallelism and slot
[confluence] JVM memory adjustment
R language dplyr package select function, group_ The by function, filter function and do function obtain the third largest value of a specific numerical data column in a specified level in a specified
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
力扣 599. 两个列表的最小索引总和
Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
关于cv2.dnn.readNetFromONNX(path)就报ERROR during processing node with 3 inputs and 1 outputs的解决过程【独家发布】
School 1 of vulnhub
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
Opencv学习笔记 高动态范围 (HDR) 成像
A pot of stew, a collection of common commands of NPM and yarn cnpm
Force buckle 599 Minimum index sum of two lists
Cloud 组件发展升级
equals 方法
MIT science and technology review article: AgI hype around Gato and other models may make people ignore the really important issues
Vulnhub's funfox2