如何在oracle中的一个作业中调用两个过程?

发布于 2024-12-15 17:13:23 字数 814 浏览 2 评论 0原文

我想知道如何从 Oracle 的一个作业中调用两个过程。我已经像下面那样提到了它,但我收到了一个错误,例如......

Error starting at line 1 in command:
    DECLARE
    JOBID NUMBER;
    BEGIN
    DBMS_JOB.SUBMIT ( 
    job => JOBID,
    what => 'BOS_CMSFUNCTIONS.INSERTISAC_EXTRACT@CMSQ7_EXT.WORLD;isacfunctions.getisac_extract',
    next_date=> TRUNC(SYSDATE+1) + 21/24,
    interval=> 'TRUNC(SYSDATE+1) + 21/24');
    COMMIT;
    END;
Error report:
ORA-06550: line 1, column 175:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
   := . ( @ % ;
The symbol ";" was substituted for "END" to continue.
ORA-06512: at "SYS.DBMS_JOB", line 82
ORA-06512: at "SYS.DBMS_JOB", line 139
ORA-06512: at line 4
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

I would like to know how to call two Procedures from a job in Oracle. I had mentioned it like the way i have done it below but i received an error like...

Error starting at line 1 in command:
    DECLARE
    JOBID NUMBER;
    BEGIN
    DBMS_JOB.SUBMIT ( 
    job => JOBID,
    what => 'BOS_CMSFUNCTIONS.INSERTISAC_EXTRACT@CMSQ7_EXT.WORLD;isacfunctions.getisac_extract',
    next_date=> TRUNC(SYSDATE+1) + 21/24,
    interval=> 'TRUNC(SYSDATE+1) + 21/24');
    COMMIT;
    END;
Error report:
ORA-06550: line 1, column 175:
PLS-00103: Encountered the symbol "END" when expecting one of the following:
   := . ( @ % ;
The symbol ";" was substituted for "END" to continue.
ORA-06512: at "SYS.DBMS_JOB", line 82
ORA-06512: at "SYS.DBMS_JOB", line 139
ORA-06512: at line 4
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初与友歌 2024-12-22 17:13:23

您需要构造一个有效的 PL/SQL 块。假设两个过程名称都是有效的并且两个过程调用都不带参数

DECLARE
  JOBID NUMBER;
BEGIN
  DBMS_JOB.SUBMIT ( 
    job => JOBID,
    what => 'BEGIN ' ||
            '  BOS_CMSFUNCTIONS.INSERTISAC_EXTRACT@CMSQ7_EXT.WORLD; ' ||
            '  isacfunctions.getisac_extract; ' ||
            'END;',
    next_date=> TRUNC(SYSDATE+1) + 21/24,
    interval=> 'TRUNC(SYSDATE+1) + 21/24');
  COMMIT;
END;

You need to construct a valid PL/SQL block. Assuming both procedure names are valid and that both procedure calls take no parameters

DECLARE
  JOBID NUMBER;
BEGIN
  DBMS_JOB.SUBMIT ( 
    job => JOBID,
    what => 'BEGIN ' ||
            '  BOS_CMSFUNCTIONS.INSERTISAC_EXTRACT@CMSQ7_EXT.WORLD; ' ||
            '  isacfunctions.getisac_extract; ' ||
            'END;',
    next_date=> TRUNC(SYSDATE+1) + 21/24,
    interval=> 'TRUNC(SYSDATE+1) + 21/24');
  COMMIT;
END;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文