• 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; 
  • 相关阅读:
    ArrayList去除集合中自定义对象元素的重复值_对象的成员变量值相同
    去除ArrayList集合中重复字符串元素方式_思路:创建新集合方式
    21班_编程入门测试题
    jh_01_编程入门小案例练习
    排列算法
    HDOJ2030汉字统计
    HDOJ2029Palindromes _easy version
    HDOJ2028Lowest Common Multiple Plus
    HDOJ2027统计元音
    HDOJ2026首字母变大写
  • 原文地址:https://www.cnblogs.com/zhuimengke/p/541636.html
Copyright © 2020-2023  润新知