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