zoukankan      html  css  js  c++  java
  • ORACLE的游标的用法

    DECLARE CURSOR CUR_M_SHOHINHOTEL IS 
    SELECT 
    H.SEQ, H.USEDATE, 
    TO_CHAR(TO_DATE('2006/12/12') + H.USEDATE - 1, 'YYYYMMDD') AS USEDAY, 
    H.HOTELCD, H.MEALTYPECD, H.ROOMCATEGORYCD, H.OUTPUTFLAG, 
    H.TKTCD, H.TKTREMARKSCD, H.SUPPLIERCD, H.SORTORDER, 
    R.NAME AS TKTREMARKSNAME, L.NAME, L.TEL, 
    H.REMARKSCD,H.SEQREMARKS, L.DISPLAYFLAG 
    From 
    
    M_SHOHINHOTEL H, 
    M_HOTEL L, 
    M_TKTREMARKS R WHERE 
    H.TKTREMARKSCD = R.CODE(+) AND 
    H.HOTELCD = L.CODE(+) AND 
    H.CODE1 = '00' AND " 
    H.CODE2 = '0000' AND " 
    H.CODE3 = '00' 
    ORDER BY H.USEDATE,H.SEQ; 
    
    TYPE_M_SHOHINHOTEL CUR_M_SHOHINHOTEL%ROWTYPE; 
    
    BEGIN 
    OPEN CUR_M_SHOHINHOTEL; 
    LOOP
    FETCH CUR_M_SHOHINHOTEL INTO TYPE_M_SHOHINHOTEL; 
    EXIT WHEN CUR_M_SHOHINHOTEL%NOTFOUND; 
    
    INSERT INTO Y_HOTEL( 
    BRANCHCD, BOOKINGNO, REV, SEQ, 
    STDATE, USEDATE, HOTELCD, MEALTYPECD, 
    FIRSTFLAG, ROOMCATEGORYCD, TKTCD, TKTREMARKSCD, 
    TKTREMARKSDETAIL,REGDATE, REGTIME, UPDCHARGER, 
    DISPLAYFLAG, SUPPLIERCD, SORTORDER, HISTORYDATE, 
    PAXMALE, PAXFEMALE, PAXCHILD, PAXINFANT, 
    STATUS, TEHAISTATUS,OUTPUTFLAG, UPDCHARGERCD, 
    HOTELNAME, HOTELTEL, REMARKSCD, SEQREMARKS 
    ) VALUES ( 
    'SZ', 
    '123456', 
    '00', 
    TYPE_M_SHOHINHOTEL.SEQ, 
    TYPE_M_SHOHINHOTEL.USEDATE, 
    YPE_M_SHOHINHOTEL.USEDAY , 
    TYPE_M_SHOHINHOTEL.HOTELCD, 
    TYPE_M_SHOHINHOTEL.MEALTYPECD, 
    
    '1', 
    TYPE_M_SHOHINHOTEL.ROOMCATEGORYCD, 
    TYPE_M_SHOHINHOTEL.TKTCD, 
    TYPE_M_SHOHINHOTEL.TKTREMARKSCD," 
    TYPE_M_SHOHINHOTEL.TKTREMARKSNAME, 
    
    TO_CHAR(SYSDATE,'YYYYMMDD')," 
    TO_CHAR(SYSDATE,'HH24MISS')," 
    'ZHUIMENGKE', 
    
    TYPE_M_SHOHINHOTEL.DISPLAYFLAG, 
    '1', 
    TYPE_M_SHOHINHOTEL.SUPPLIERCD, 
    TYPE_M_SHOHINHOTEL.SORTORDER, 
    TO_CHAR(SYSDATE,'YYYYMMDD'), 
    1, 
    2, 
    3, 
    4, 
    '0', '0', 
    TYPE_M_SHOHINHOTEL.OUTPUTFLAG, 
    'ZHUIMENGKE', 
    TYPE_M_SHOHINHOTEL.NAME, 
    TYPE_M_SHOHINHOTEL.TEL, 
    TYPE_M_SHOHINHOTEL.REMARKSCD, 
    TYPE_M_SHOHINHOTEL.SEQREMARKS); 
    END LOOP; 
    CLOSE CUR_M_SHOHINHOTEL; 
    END; 
  • 相关阅读:
    搭建LAMP环境部署discuz论坛
    25. SpringBoot 嵌入式Servlet容器配置修改
    7. mybatis sql 语句的抽取
    6. 动态 SQL 之<foreach>
    58. VUE 路径别名
    57. VUE TabBar 开发
    24. SpringBoot 自定义异常信息
    5. MyBatis 动态SQl语句 的使用
    4. Dao层 代理开发方式
    56. VUE keep-alive 组件视图缓存
  • 原文地址:https://www.cnblogs.com/zhuimengke/p/541636.html
Copyright © 2011-2022 走看看