PL/SQL Oracle DBMS_JOB/DBMS_SCHEDULER 传递参数
如何将参数传递给 DBMS_JOB/SCHEDULER 异步调用。我有一个长期运行的 PL/SQL 过程,它需要很少的参数,包括 SQL 整数表 (ids)。如何创建异步调用此 PL/SQL 长时间运行过程并向其传递参数的过程?
PROCEDURE "RUN_ARCHIVING_SEARCH"
(
a_arch_rule_code_id_list IN INLISTNUMBERS,
a_lang IN VARCHAR2,
a_session_id IN NUMBER
)
谢谢, 牛肉
How do I pass parameters to DBMS_JOB/SCHEDULER async call. I have long running PL/SQL procedure, which takes few parameters, including SQL table of integers (ids). How do I create procedure which calls this PL/SQL long running procedure asynchronosly and passes parameters to it?
PROCEDURE "RUN_ARCHIVING_SEARCH"
(
a_arch_rule_code_id_list IN INLISTNUMBERS,
a_lang IN VARCHAR2,
a_session_id IN NUMBER
)
Thnx,
Beef
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要创建
program_type
为'STORED_PROCEDURE'
的程序,而是尝试创建作业,其中每个作业的job_type
是'PLSQL_BLOCK'
。这样,您的 job_action 实际上是使用适当参数调用存储过程所需的 PL/SQL 块。理论上,您可以使用重新创建a_arch_rule_code_id
所需的代码即时构建 PL/SQL 块。Instead of creating a program whose
program_type
is'STORED_PROCEDURE'
, try creating jobs where each job'sjob_type
is'PLSQL_BLOCK'
. This way, yourjob_action
is actually the PL/SQL block necessary to call your stored procedure with the appropriate arguments. You could theoretically fabricate the PL/SQL block on-the-fly with the code necessary to re-createa_arch_rule_code_id
.根据您可能需要传递给过程的最大数字数量,您可能最好将数字存储在表中,然后作业将查询该表以获取要处理的数字。
Depending on the maximum number of numbers you might need to pass to the procedure, you're probably better off storing the numbers in a table, then the job will query the table to get the numbers to process.