当前位置:网站首页>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;
边栏推荐
- vulnhub之Funfox2
- torch.nn.functional.pad(input, pad, mode=‘constant‘, value=None)记录
- MIT science and technology review article: AgI hype around Gato and other models may make people ignore the really important issues
- My creation anniversary
- 九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
- MSE API learning
- Semantic SLAM源码解析
- Cloud 组件发展升级
- torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
- ASP. Net kindergarten chain management system source code
猜你喜欢

mock. JS returns an array from the optional data in the object array

Automatic classification of defective photovoltaic module cells in electroluminescence images-論文閱讀筆記

Navicat连接2002 - Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘解决

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

vulnhub之tre1

国家网信办公布《数据出境安全评估办法》:累计向境外提供10万人信息需申报

Vulnhub tre1

Cloud component development and upgrading

9 atomic operation class 18 Rohan enhancement

Automatic classification of defective photovoltaic module cells in electroluminescence images-论文阅读笔记
随机推荐
力扣 643. 子数组最大平均数 I
R language ggplot2 visualization: use the ggdensity function of ggpubr package to visualize the packet density graph, and use stat_ overlay_ normal_ The density function superimposes the positive dist
线性基
Kubernetes——kubectl命令行工具用法详解
YoloV6:YoloV6+Win10---训练自己得数据集
Vulnhub tre1
Data island is the first danger encountered by enterprises in their digital transformation
841. String hash
Throughput
力扣674. 最长连续递增序列
R language ggplot2 visualization: use the ggecdf function of ggpubr package to visualize the grouping experience cumulative density distribution function curve, and the linetype parameter to specify t
pom. XML configuration file label: differences between dependencies and dependencymanagement
torch.nn.functional.pad(input, pad, mode=‘constant‘, value=None)记录
Force buckle 674 Longest continuous increasing sequence
831. KMP string
力扣 2315.统计星号
Yolov6:yolov6+win10--- train your own dataset
MSE API learning
编译器优化那些事儿(4):归纳变量
SQL common optimization