--定时任务
declare job20 number;
begin
sys.dbms_job.submit(job20,'test1;',sysdate,'sysdate+1');
end; --存储过程
create or replace procedure test3
as
xh_zgid varchar();
xh_zggh varchar();
xh_xm varchar();
xh_grdh varchar();
xh_count int;
xh_dxxh int;
xh_zfqnr varchar();
--游标
CURSOR z1 is
select zgid,zggh,xm,grdh from RSGL_ZGDA where zxpb= and (rdsj is not null )and zxpb= AND to_char(rdsj,'yyyy')!='' and (to_char(rdsj,'MM-dd')) = (to_char(sysdate,'MM-dd'));
begin
select NR into xh_zfqnr from OA_ZFQ where zfqid='DYSR';
select to_number(dqz) into xh_dxxh from xt_xhb where bm='SMS_DAIFASONG_DX';
dbms_output.put_line(xh_dxxh);
open z1;
loop
fetch z1 into xh_zgid,xh_zggh,xh_xm,xh_grdh;
if z1 %notfound then exit;end if;
select count(*) into xh_count from BirthDayTip_jl where zgid=xh_zgid and jlsj=to_char(sysdate,'yyyy/MM/dd');
dbms_output.put_line(xh_count);
if xh_count< then
xh_dxxh:=xh_dxxh+;
insert into BirthDayTip_jl(zgid,phone,Jlsj) values(xh_zgid,xh_grdh,to_char(sysdate,'yyyy/MM/dd'));
insert into sms_daifasong_dx(WEIYIBM,FASONGR,FASONGSJ,DUANXINNR,FASONGLX,SHOUJIHM) values(xh_dxxh,xh_xm,sysdate,xh_zfqnr,'',xh_grdh);
dbms_output.put_line(xh_dxxh);
dbms_output.put_line(xh_xm);
dbms_output.put_line(sysdate);
dbms_output.put_line(xh_zfqnr);
dbms_output.put_line(xh_grdh); end if;
end loop;
close z1;
update xt_xhb set dqz=to_char((xh_dxxh)) where bm='SMS_DAIFASONG_DX';
end; --执行存储过程 begin
test3;
commit;
end;

学到的语法规范:

--查询语句赋值时

select  字段名 into 变量名  from 表 where 条件

--变量名计算时

变量名:=变量名 运算符 值(变量名+1)

最新文章

  1. python——threading模块
  2. sgu 104 Little shop of flowers 解题报告及测试数据
  3. Uedit的快捷键
  4. PYTHON实现HTTP基本认证(BASIC AUTHENTICATION)
  5. 安装app到Simulator
  6. 【JS】(+﹏+)~
  7. 找不到这个cache.properties缓存文件
  8. CoreData概略
  9. Web数据库的UI框架 Evolutility
  10. nodeJS之进程process对象
  11. Leetcode题解(十一)
  12. 安装基准测试工具sysbench
  13. 简单docker镜像修改方式
  14. easyui时的时间格式yyyy-MM-dd与yyyy-MM-ddd HH:mm:ss
  15. InstallShield:卸载时文字叠加,文字乱码
  16. Ubuntu 16.04 ORB_SLAM2+ROS+usb_cam+AR
  17. python you-get 下载视频
  18. VBA json parser[z]
  19. P2657 [SCOI2009]windy数
  20. javascript右下角弹层及自动隐藏

热门文章

  1. 终极解决liunx GUI 无法显示中文的问题。
  2. Sitecore CMS中更改项目的模板
  3. 【转】Spotlight实时监控Windows Server 2008
  4. twiested 及其他轮子
  5. ELK学习笔记之F5 DNS可视化让DNS运维更安全更高效-F5 ELK可视化方案系列(3)
  6. Maven 工程读取resource下的文件
  7. bzoj4720 / P1850 换教室(Floyd+期望dp)
  8. Hashtable与HashMap的区别
  9. java bean属性拷贝工具类比对(性能+功能)
  10. 14: element ui 使用