oracle sql开发人员电子邮件警报

时间:2014-12-08 04:43:20

标签: oracle

你可以帮我查一下吗 这不起作用 我们需要特殊utl_mail吗 不知道这个utl_mail是什么

create or replace 
procedure check_stock_qty
begin

for r  ( select inv_qoh from inventory
                where qty = 0 )
     loop
         UTL_MAIL.send(sender => 'na@yahoo.com',
        recipients => 'krn9@mail.ca',
         subject => 'Test Mail',
         message => (r.inv_qoh),
      mime_type => 'text; charset=us-ascii'); 
     end loop;
end;

BEGIN
    dbms_scheduler.create_job (
        job_name        => 'stock check',
        job_type        => 'PLSQL_BLOCK',
        job_action      => 'BEGIN check_stock_qty; END;',
        start_date      => SYSTIMESTAMP,
        repeat_interval => 'freq=minutely; interval=7200; bysecond=0;',
        end_date        => NULL,
        enabled         => TRUE,
END;

我的错误是

Error(2,1): PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:     ( ; is with authid as cluster compress order using compiled    wrapped external deterministic parallel_enable pipelined    result_cache 

2 个答案:

答案 0 :(得分:0)

创建过程的语法是

create or replace procedure <Name>
  (<variable list>)
as (or is)

  local variable declaration
begin
    code section
  exceptions
end;

IS之前您错过了ASBEGIN关键字

答案 1 :(得分:0)

我试着用

错误(5,8):PLS-00103:遇到符号“(”当遇到下列情况之一时:在符号“in”中替换为“(”继续。 错误(16,1):PLS-00103:遇到符号“BEGIN” 错误(25,1):PLS-00103:当遇到以下情况之一时遇到符号“END”:( - + case mod new not null continue avg count current exists last min before sql stddev sum variance execute forall merge time timestamp interval日期管道

这么多错误:(