create or replace procedure P_updateas
begin
update security_price p
set p.closing_price =
(select MIN(a.close_price) KEEP(DENSE_RANK last ORDER BY trade_date)
from DATAAPP1.cicc_index_daily@WIND a
where to_date(a.trade_date, 'yyyymmdd') <=p.pricing_date
and a.sec_name = '沪深300全收益'
and a.ticker = 'h00300'
)
where p.security_id = 1000006869;

update security_price p
set p.closing_price =
(select MIN(a.close_price) KEEP(DENSE_RANK last ORDER BY trade_date)
from DATAAPP1.cicc_index_daily@WIND a
where to_date(a.trade_date, 'yyyymmdd') <=p.pricing_date
and a.sec_name = '中证500全收益'
and a.ticker = 'h00905'
)
where p.security_id = 1000029000000002;

update security_price p
set p.closing_price =
(select MIN(a.close_price) KEEP(DENSE_RANK last ORDER BY trade_date)
from DATAAPP1.cicc_index_daily@WIND a
where to_date(a.trade_date, 'yyyymmdd') <=p.pricing_date
and a.sec_name = '上证50全收益'
and a.ticker = 'h00016'
)
where p.security_id = 1000034700000001;

update security s
set s.latest_close_price =
(select MIN(a.close_price) KEEP(DENSE_RANK last ORDER BY trade_date)
from DATAAPP1.cicc_index_daily@WIND a where a.sec_name = '沪深300全收益' and a.ticker = 'h00300')
where s.id = 1000006869;

update security s
set s.latest_close_price =
(select MIN(a.close_price) KEEP(DENSE_RANK last ORDER BY trade_date)
from DATAAPP1.cicc_index_daily@WIND a where a.sec_name = '中证500全收益' and a.ticker = 'h00905')
where s.id = 1000029000000002;

update security s
set s.latest_close_price =
(select MIN(a.close_price) KEEP(DENSE_RANK last ORDER BY trade_date)
from DATAAPP1.cicc_index_daily@WIND a where a.sec_name = '上证50全收益' and a.ticker = 'h00016')
where s.id = 1000034700000001;

COMMIT;

end p_update_price;

declare
job number;
begin
sys.dbms_job.submit(
job => job,
what => 'p_update_price;',
next_date => to_date('10-08-2018 18:30:00', 'dd-mm-yyyy hh24:mi:ss'),
interval =>'trunc(sysdate)+1+(18*60+30)/(24*60)');
commit;
end;

sql backup的更多相关文章

  1. SQL backup&restore

    --完整备份Backup Database NorthwindCSTo disk='G:\Backup\NorthwindCS_Full_20070908.bak' --差异备份Backup Data ...

  2. MS SQL backup database的俩个参数

    http://msdn.microsoft.com/zh-cn/library/ms186865.aspx 数据传输选项 BUFFERCOUNT = { buffercount | @bufferco ...

  3. 第一章、关于SQL Server数据库的备份和还原(sp_addumpdevice、backup、Restore)

    在sql server数据库中,备份和还原都只能在服务器上进行,备份的数据文件在服务器上,还原的数据文件也只能在服务器上,当在非服务器的机器上启动sql server客户端的时候,也可以通过该客户端来 ...

  4. SQL Server 大数据搬迁之文件组备份还原实战

    一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 解决方案(Solution) 搬迁步骤(Procedure) 搬迁脚本(SQL Codes) ...

  5. SQL Server 批量完整备份

    一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 实现代码(SQL Codes) 实现方式一(One) 实现方式二(Two) 实现方式三(Thr ...

  6. backup log is terminating abnormally because for write on file failed: 112(error not found)

    昨天遇到一个案例,YourSQLDba做事务日志备份时失败,检查YourSQLDba输出的错误信息如下: <Exec> <ctx>yMaint.backups</ctx& ...

  7. C#对SQL Server数据库的备份与还原

    备份数据库: string connectionString = "server=服务器名称;database=数据库名;uid=登入名;pwd=登入密码";         // ...

  8. --自动创建备份SQL

    --自动创建备份SQL DECLARE @dbname VARCHAR(50) ,--要备份的数据库名称 @bakname VARCHAR(50) ,--备份后的bat名称 @sql VARCHAR( ...

  9. SQL Server中的事务日志管理(3/9):事务日志,备份与恢复

    当一切正常时,没有必要特别留意什么是事务日志,它是如何工作的.你只要确保每个数据库都有正确的备份.当出现问题时,事务日志的理解对于采取修正操作是重要的,尤其在需要紧急恢复数据库到指定点时.这系列文章会 ...

随机推荐

  1. semver 版本号命名法

    https://semver.org/lang/zh-CN/ 版本格式:主版本号.次版本号.修订号,版本号递增规则如下: 主版本号:当你做了不兼容的 API 修改, 次版本号:当你做了向下兼容的功能性 ...

  2. kibana test

    https://www.cnblogs.com/yiwangzhibujian/p/7137546.html curl -XPUT http://localhost:9200/shakespeare ...

  3. 兴趣点 / 关键点( Interest point/Keypoint )

    • 不同视角图片之间的映射           • 稳定局部特征点           • 可重复性.显著性           • 抗图片变换           • 外貌变换(亮度.光照)    ...

  4. matlab 画二维图与三维图

    二维图 ezplot('sin(x)');%默认范围 ezplot('sin(x)',[-4 4]);%自己设定范围 三维图 ezmesh('x*x+y*y');%默认范围

  5. 大型运输行业实战_day01_1_业务分析

    1.业务分析 发展历史:  上车收费-->车站买票(相当于先收钱后上车)-->站务系统--->联网售票 2.项目结构 3.开发流程分析 1.业务分析            图文并茂  ...

  6. mysql limit语句

    [mysql limit语句] 代码: SELECT * FROM table LIMIT 2 OFFSET 1; 比如这个SQL ,limit后面跟的是2条数据,offset后面是从第1条开始读取. ...

  7. 循环流程控制&方法(3)

    1.循环流程控制 当某一段代码需要重复执行多次的时候,就需要用到循环: 循环三要素: 循环的起点:循环的终点(结束条件):步长: 当循环条件不再成立,结束循环: for循环 for(循环起点:循环条件 ...

  8. SOA 是什么

    SOA 英文:Service-Oriented Architecture,面向服务的架构. 是一种面向通用集成服务的.松耦合的架构实现方式,是web时代服务发展的产物: 使用"分层" ...

  9. Linux下鼠标滚轮速度调整

    安装imwheel 于home下创建.imwheelrc gedit ~/.imwheelrc 在.imwheelrc中粘贴以下内容 ".*" None, Up, Button4, ...

  10. IDEA错误:Cannot start compilation: the output path is not specified for module "Test". Specify the out

    错误是发生在从github上checkout自己的项目时.因为没有将配置文件一起上传,所以在运行Java程序时有了这个报错: Cannot start compilation: the output ...