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. tomcat8 web工程启动,登陆页面失败问题解决

    编辑该文件context.xml 增加以下内容 <CookieProcessor className="org.apache.tomcat.util.http.LegacyCookie ...

  2. 【364】SVM 通过 sklearn 可视化实现

    先看下效果图: # 先调入需要的模块 import numpy as np import matplotlib.pyplot as plt from sklearn import svm import ...

  3. TFS登录时保存了用户密码,如何用其他账户登录

      来源:http://blog.csdn.net/littlegreenfrog/article/details/5254633 使用TFS2008过程中,常常由于已经保存用户名和密码,却没有重新登 ...

  4. Jsp基本语法 第二节

    关于JSP的声明   即在JSP页面定义方法或者变量: <%!Java代码%> 在JSP页面中执行的表达式:<%=表达式%>   这个里尤其注意不能以:结束 JSP页面生命周期 ...

  5. python3编译安装

    linux下配置安装python3一.首先,官网下载python3的所需版本.wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz ...

  6. opencv对手写数字进行无黏连切割

    //src:待分割的二值图,最大值为255 //segMat:分割好的每个图片 //算法:判断连通域,有几个连通域就会分割成几个子图片 //用途:手写数字识别中进行无黏连数字的分割 void getC ...

  7. conductor编译镜像

    # git clone https://github.com/Netflix/conductor.git # git checkout -b 2.0 remotes/origin/2.0 # cd s ...

  8. Java计算计算活了多少天

    Java计算计算活了多少天 思路: 1.输入你的出现日期: 2.利用日期转换,将字符串转换成date类型 3.然后将date时间换成毫秒时间 4.然后获取当前毫秒时间: 5.最后计算出来到这个时间多少 ...

  9. clearfix原理

    [clearfix原理] .clearfix:after { <----在类名为“clearfix”的元素内最后面加入内容: content: "."; <----内容 ...

  10. python学习day7 数据类型及内置方法补充

    http://www.cnblogs.com/linhaifeng/articles/7133357.html#_label4 1.列表类型 用途:记录多个值(一般存放同属性的值) 定义方法 在[]内 ...