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

Dynamic addition of El upload upload component; El upload dynamically uploads files; El upload distinguishes which component uploads the file.

Cloud component development and upgrading

The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared

Cloud 组件发展升级

The boundary of Bi: what is bi not suitable for? Master data, Martech? How to expand?

开源OA开发平台:合同管理使用手册

Chapter 9 Yunji datacanvas company won the highest honor of the "fifth digital finance innovation competition"!

模拟实现string类

九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!

RESTAPI 版本控制策略【eolink 翻译】
随机推荐
mock. JS returns an array from the optional data in the object array
力扣 1961. 检查字符串是否为数组前缀
gorilla官方:golang开websocket client的示例代码
力扣 459. 重复的子字符串
Oracle 存储过程之遍历
torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
pom.xml 配置文件标签:dependencies 和 dependencyManagement 区别
CSDN语法说明
MIT science and technology review article: AgI hype around Gato and other models may make people ignore the really important issues
Tp6 realize Commission ranking
Implement secondary index with Gaussian redis
Navicat连接2002 - Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘解决
Throughput
Make this crmeb single merchant wechat mall system popular, so easy to use!
Cloud component development and upgrading
Flink并行度和Slot详解
Vulnhub's funfox2
About cv2 dnn. Readnetfromonnx (path) reports error during processing node with 3 inputs and 1 outputs [exclusive release]
TS快速入门-泛型
多个线程之间如何协同