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 中使用线程吗?


- SQL 临时表问题 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 更改自动增量起始编号? 2021-01-01