oracle 定时器移数据,oracle 定时器的使用

我首先建了一张表 然后存了一些英语名言。然后我写了一个存储过程,然后我把存储过程放到定时任务里。然后定一分钟给他发一封。。。然后他把我拉黑了。。。。。

SELECT * FROM wp_rq

2  I figure life is a gift and I don’t intend on wasting it.

3  Let life be beautiful like summer flowers

4  Everything you see exists together in a delicate balance.

5  The world makes way for the man who knows where he is going.

6  Everything you see exists together in a delicate balance.

7  Have you given any thought to your future?

8  A bird is known by its note, and a man by his talk.

9  All play and no work makes Jack a mere boy.

10  A clean hand wants no washing.

create or replace procedure test as

i NUMBER:=1;

o NUMBER;

val VARCHAR2(200):=’For beautiful eyes, look for the good in others.’;

begin

SELECT COUNT(*) INTO i FROM wp_rq;

SELECT round(dbms_random.value(1,i)) INTO o FROM dual;

dbms_output.put_line(i||’–ucjmh’);

SELECT quotation INTO val FROM wp_rq WHERE ID=o+1;

dbms_output.put_line(val||’–ucjmh’);

send_mail(p_recipient => ‘zhoulei@wondersgroup.com’, p_message =>val||’      This is an automatically email from oracle . And when every other one hour will send a letter to you’ , p_subject =>’English words’

);

end;

l

BEGIN

TEST();

END ;

SQL> variable job1 number;

SQL> begin

2  dbms_job.submit(:job1,’test;’,sysdate,’sysdate+1/1440′);

3  end;

4  /

PL/SQL procedure successfully completed

job1

———

3

SQL> begin

2  dbms_job.run(:job1);

3  end;

4  /

PL/SQL procedure successfully completed

job1

———

3

SQL> begin

2  dbms_job.remove(:job1);

3  end;

4  /

PL/SQL procedure successfully completed

job1

———

3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值