我们可以使用PL / SQL线程? [英] Can We use threading in PL/SQL?
问题描述
有没有在PL / SQL调用异步的任何功能?
假设我在code块想调用过程多次,不会理会的时候,什么过程返回?
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;
在上述情况下,我不希望我的code等待MYPROC(1,100)执行之前完成处理(101,200)结果
谢谢你。
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.
如果您有执行连续按行方式的程序,你会发现,它是缓慢的,答案很可能是不多次simltaneously运行程序,但以确保基于集合的形式给出来代替。在一个极端的你甚至可以再使用并行查询和并行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线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!