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
PEN CUR_M_SHOHINHOTEL;
Loop
FETCH CUR_M_SHOHINHOTEL INTO TYPE_M_SHOHINHOTEL;
EXIT WHEN CUR_M_SHOHINHOTEL%NOTFOUND;