免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5177 | 回复: 16
打印 上一主题 下一主题

schedule.job的job action 怎么传递Procedure的参数? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-09 15:19 |只看该作者 |倒序浏览
20可用积分
RT
上图:
-----------

------------
图中的参数应该怎么传递,比如20090305000000 这个字符型时间怎么传进去?

RPT是一个包
e_per_rpt是个存储过程, 接收两个varchar2型参数,我想传递两个''给这两个参数,应该怎么做?

[ 本帖最后由 TOADLover 于 2009-10-12 09:38 编辑 ]

最佳答案

查看完整内容

就用DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE 啊~上面已经举例了BEGINDBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE ( job_name => 'ops_reports', argument_position => 2, argument_value => '12-DEC-03');END;

论坛徽章:
0
2 [报告]
发表于 2009-10-09 15:19 |只看该作者
就用DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE 啊~
上面已经举例了
BEGIN
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
   job_name                => 'ops_reports',
   argument_position       => 2,
   argument_value          => '12-DEC-03');
END;

论坛徽章:
0
3 [报告]
发表于 2009-10-09 15:36 |只看该作者

怎么了? 大家都不回我帖子?

怎么了?

论坛徽章:
0
4 [报告]
发表于 2009-10-09 15:42 |只看该作者

回复 #1 TOADLover 的帖子

job_action => 'OPS.SALES_PKG.UPDATE_SALES_SUMMARY',
Using the Scheduler (9 October 2009)
http://download.oracle.com/docs/ ... heduse.htm#i1009668

论坛徽章:
0
5 [报告]
发表于 2009-10-09 15:45 |只看该作者
job_name => 'ops_reports', argument_position => 2, argument_value => '12-DEC-03');
Using the Scheduler (9 October 2009)
http://download.oracle.com/docs/ ... heduse.htm#i1009668

自己通过连接看吧,我想给你拷贝过来,CU上发不上去。

论坛徽章:
0
6 [报告]
发表于 2009-10-09 15:49 |只看该作者
Setting Job Arguments

After creating a job, you may need to set job arguments if:

    *

      The inline job action is a stored procedure or other executable that requires arguments
    *

      The job references a named program object and you want to override one or more default program arguments
    *

      The job references a named program object and one or more of the program arguments were not assigned a default value

To set job arguments, use the SET_JOB_ARGUMENT_VALUE or SET_JOB_ANYDATA_VALUE procedures or Enterprise Manager. SET_JOB_ANYDATA_VALUE is used for complex data types that must be encapsulated in an ANYDATA object.

An example of a job that might need arguments is one that starts a reporting program that requires a start date and end date. The following code example sets the end date job argument, which is the second argument expected by the reporting program:

BEGIN
DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE (
   job_name                => 'ops_reports',
   argument_position       => 2,
   argument_value          => '12-DEC-03');
END;
/


Using the Scheduler (9 October 2009)
[url]http://download.orac

论坛徽章:
0
7 [报告]
发表于 2009-10-09 16:13 |只看该作者
原帖由 ziggler 于 2009-10-9 15:45 发表
job_name => 'ops_reports', argument_position => 2, argument_value => '12-DEC-03');
Using the Scheduler (9 October 2009)
http://download.oracle.com/docs/ ... 02/b14231/scheduse. ...


----------
谢谢。

可是这份文档,说的都是不常用的。
最常用的job_type 是store Procedure,却没有提到啊:

BEGIN
DBMS_SCHEDULER.CREATE_JOB (
   job_name                 =>  'my_new_job2',
   job_type                 =>  'PLSQL_BLOCK',
   job_action               =>  'BEGIN SALES_PKG.UPDATE_SALES_SUMMARY; END;',
   schedule_name            =>  'my_saved_schedule');
END;
/


而且这里也没提到如何用单引号的问题????

论坛徽章:
0
8 [报告]
发表于 2009-10-09 16:16 |只看该作者

回复 #6 TOADLover 的帖子

job_type => 'STORED_PROCEDURE',
Using the Scheduler (9 October 2009)
http://download.oracle.com/docs/ ... heduse.htm#i1009668


提到了啊

论坛徽章:
0
9 [报告]
发表于 2009-10-12 09:04 |只看该作者

回复 #1 TOADLover 的帖子

谢谢Ziggler回帖,感谢。

我想问问:

schedule.job的job action 怎么传递Procedure的参数呢? 比如我在一楼贴的图,怎么传递两个''空给这个Procedure呢?

论坛徽章:
0
10 [报告]
发表于 2009-10-12 09:34 |只看该作者
schedule.job的job action 怎么传递Procedure的参数呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP