Can We use threading in PL/SQL?(我们可以在 PL/SQL 中使用线程吗?)
问题描述
PL/SQL 中有异步调用的特性吗?假设我在一个代码块中想要多次调用一个过程并且不会打扰过程返回的时间和内容?
Is there any feature of asynchronous calling in PL/SQL? Suppose I am in a block of code would like to call a procedure multiple times and wouldn't bother when and what the procedure returns?
BEGIN
myProc(1,100);
myProc(101,200);
myProc(201,300);
...
...
END;
在上述情况下,我不希望我的代码在执行(101,200)之前等待 myProc(1,100) 完成处理
谢谢.
In the above case, I don't want my code to wait for myProc(1,100) to finish processing before executing(101,200)
Thanks.
推荐答案
+1 用于 DBMS_SCHEDULER 和 DBMS_JOB 方法,但也要考虑您是否应该使用不同的方法.
+1 for DBMS_SCHEDULER and DBMS_JOB approaches, but also consider whether you ought to be using a different approach.
如果您有一个以逐行方式执行的过程并且您发现它很慢,那么答案可能不是同时多次运行该过程而是确保使用基于集合的方法.在极端情况下,您甚至可以使用并行查询和并行 DML 来减少进程的挂钟时间.
If you have a procedure which executes in a row-by-row manner and you find that it is slow, the answer is probably not to run the procedure multiple times simltaneously but to ensure that a set-based aproach is used instead. At an extreme you can even then use parallel query and parallel DML to reduce the wall clock time of the process.
我提到这个只是因为这是一个很常见的错误.
I mention this only because it is a very common fault.
这篇关于我们可以在 PL/SQL 中使用线程吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:我们可以在 PL/SQL 中使用线程吗?


基础教程推荐
- 从字符串 TSQL 中获取数字 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01