当前位置:网站首页>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;
边栏推荐
- Notes...
- c语言如何判定是32位系统还是64位系统
- Tp6 realize Commission ranking
- vulnhub之Funfox2
- Chapter 20 using work queue manager (3)
- 整型int的拼接和拆分
- Force buckle 1037 Effective boomerang
- torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
- Interpretation of transpose convolution theory (input-output size analysis)
- 多个线程之间如何协同
猜你喜欢
BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?
Simulate the implementation of string class
School 1 of vulnhub
使用高斯Redis实现二级索引
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
干货分享|DevExpress v22.1原版帮助文档下载集合
力扣 2319. 判断矩阵是否是一个 X 矩阵
Interpretation of transpose convolution theory (input-output size analysis)
Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.
How to cooperate among multiple threads
随机推荐
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
Force buckle 643 Subarray maximum average I
School 1 of vulnhub
MIT科技评论文章:围绕Gato等模型的AGI炒作可能使人们忽视真正重要的问题
vulnhub之Funfox2
Data island is the first danger encountered by enterprises in their digital transformation
R language uses ggplot2 function to visualize the histogram distribution of counting target variables that need to build Poisson regression model, and analyzes the feasibility of building Poisson regr
浅尝不辄止系列之试试腾讯云的TUIRoom(晚上有约,未完待续...)
torch.nn.functional.pad(input, pad, mode=‘constant‘, value=None)记录
搞定带WebKitFormBoundary post登录
整型int的拼接和拆分
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
Browse the purpose of point setting
力扣 599. 两个列表的最小索引总和
[auto.js] automatic script
BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?
ASP. Net kindergarten chain management system source code
微信公众号OAuth2.0授权登录并显示用户信息
力扣 2319. 判断矩阵是否是一个 X 矩阵
Force buckle 1961 Check whether the string is an array prefix