today:
50
yesterday:
242
Total:
1,004,208

General control break

admin 2016.06.25 05:18 Views : 398

declare

apply_yy      number := 0;
apply_yymmdd  number := 0;

intial_sw  number(1) := 0;
IDETIAL_NO  number := 0;

weekly_amount  number := 0;
offer_type_1_amt number := 0;
offer_type_2_amt number := 0;
offer_type_3_amt number := 0;
offer_type_4_amt number := 0;
offer_type_5_amt number := 0;
offer_type_6_amt number := 0;
offer_type_7_amt number := 0;
offer_type_8_amt number := 0;
offer_type_9_amt number := 0;
offer_type_10_amt number := 0;
offer_type_11_amt number := 0;
offer_type_12_amt number := 0;
offer_type_13_amt number := 0;
offer_type_14_amt number := 0;
offer_type_15_amt number := 0;
offer_type_16_amt number := 0;
offer_type_17_amt number := 0;
offer_type_18_amt number := 0;



begin

for c1 in  (select IAPPLY_DT,  SOFFERING_TYP, MOFFERING_AMT  from TBLOFFERDETAIL 
    where  MOFFERING_AMT  is not null 
     and   substr (IAPPLY_DT,1,6) =  ( select TO_CHAR(ADD_MONTHS(SYSDATE, -4), 'YYYYMM') from dual )  ----201602
    order by IAPPLY_DT )
    
 

  loop 
   
    IDETIAL_NO :=   IDETIAL_NO +1;

   if intial_sw  = 0 then 
       apply_yymmdd :=  c1.IAPPLY_DT;
       intial_sw  := 1; 
   end if;
       
  IF  apply_yymmdd =  c1.IAPPLY_DT then 
        weekly_amount :=  weekly_amount + c1.MOFFERING_AMT;
   IF  c1.SOFFERING_TYP = '1' then 
        offer_type_1_amt := offer_type_1_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '2' then 
            offer_type_2_amt := offer_type_2_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '3' then 
            offer_type_3_amt := offer_type_3_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '4' then 
            offer_type_4_amt := offer_type_4_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '5' then 
            offer_type_5_amt := offer_type_5_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '6' then 
            offer_type_6_amt := offer_type_6_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '7' then 
            offer_type_7_amt := offer_type_7_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '8' then 
            offer_type_8_amt := offer_type_8_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '9' then 
            offer_type_9_amt := offer_type_9_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '10' then 
            offer_type_10_amt := offer_type_10_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '11' then 
            offer_type_11_amt := offer_type_11_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '12' then 
            offer_type_12_amt := offer_type_12_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '13' then 
            offer_type_13_amt := offer_type_13_amt + c1.MOFFERING_AMT;
     elsif  c1.SOFFERING_TYP = '14' then 
            offer_type_14_amt := offer_type_14_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '15' then 
            offer_type_15_amt := offer_type_15_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '16' then 
            offer_type_16_amt := offer_type_16_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '17' then 
            offer_type_17_amt := offer_type_17_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '18' then 
           offer_type_18_amt := offer_type_18_amt + c1.MOFFERING_AMT;
    else offer_type_18_amt := offer_type_18_amt + c1.MOFFERING_AMT;
    end if; 
 
ELSE
        apply_yy := substr(apply_yymmdd,1,4);

if weekly_amount != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES (  apply_yy  , 'IDON01WK99' ,  99,  weekly_amount , 'WEEKLY Total',    apply_yymmdd, IDETIAL_NO );
end if; 
if   offer_type_1_amt  != 0 then 
  INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES  (  apply_yy  , 'IDON01WK1' ,  1,  offer_type_1_amt , 'WEEKLY Tithes',    apply_yymmdd, IDETIAL_NO );
end if;
if   offer_type_2_amt != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK2' ,  2,   offer_type_2_amt , 'WEEKLY Thanks',    apply_yymmdd, IDETIAL_NO );
end if;
if   offer_type_3_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK3' ,  3,   offer_type_3_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_4_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK4' ,  4,   offer_type_4_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_5_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK5' ,  5,   offer_type_5_amt , 'WEEKLY SpecialFirm',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_6_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK6' ,  6,   offer_type_6_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_7_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK7' ,  7,   offer_type_7_amt , 'WEEKLY Steward',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_8_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK3' ,  8,   offer_type_8_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_9_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK9' ,  9,   offer_type_9_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_10_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK10' ,  10,   offer_type_10_amt , 'WEEKLY Retreat',    apply_yymmdd, IDETIAL_NO );
 end if;

if   offer_type_11_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK3' ,  11,   offer_type_11_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;
if   offer_type_12_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK12' ,  12,   offer_type_12_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_13_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK13' ,  13,   offer_type_13_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

 if  offer_type_14_amt != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK14' ,  14,   offer_type_14_amt , 'WEEKLY Five_Two',    apply_yymmdd, IDETIAL_NO );
end if;
if offer_type_15_amt != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK15' ,  15,   offer_type_15_amt , 'WEEKLY Post Offering',    apply_yymmdd, IDETIAL_NO );     
end if;
if offer_type_16_amt != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK16' ,  16,   offer_type_16_amt , 'WEEKLY EM',    apply_yymmdd, IDETIAL_NO );
end if;
if offer_type_17_amt != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK17' ,  17,   offer_type_17_amt , 'WEEKLY Elder',    apply_yymmdd, IDETIAL_NO );
 end if;
 if offer_type_18_amt != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK18' ,  18,   offer_type_18_amt , 'WEEKLY Thousand',    apply_yymmdd, IDETIAL_NO );
END IF;     

     apply_yymmdd :=  c1.IAPPLY_DT ;
       
       IDETIAL_NO := 0;

       weekly_amount  := 0;
       offer_type_1_amt  := 0;
       offer_type_2_amt  := 0;
       offer_type_3_amt  := 0;
       offer_type_4_amt  := 0;
       offer_type_5_amt  := 0;
       offer_type_6_amt  := 0;

       offer_type_7_amt  := 0;
       offer_type_8_amt  := 0;
       offer_type_9_amt  := 0;

       offer_type_10_amt  := 0;
       offer_type_11_amt  := 0;
       offer_type_12_amt  := 0;
       offer_type_13_amt  := 0;
 
       offer_type_14_amt  := 0;
       offer_type_15_amt  := 0;
       offer_type_16_amt  := 0;
       offer_type_17_amt  := 0;
	offer_type_18_amt  := 0;

     weekly_amount :=  weekly_amount + c1.MOFFERING_AMT;

  IF  c1.SOFFERING_TYP = '1' then 
        offer_type_1_amt := offer_type_1_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '2' then 
            offer_type_2_amt := offer_type_2_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '3' then 
            offer_type_3_amt := offer_type_3_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '4' then 
            offer_type_4_amt := offer_type_4_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '5' then 
            offer_type_5_amt := offer_type_5_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '6' then 
            offer_type_6_amt := offer_type_6_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '7' then 
            offer_type_7_amt := offer_type_7_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '8' then 
            offer_type_8_amt := offer_type_8_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '9' then 
            offer_type_9_amt := offer_type_9_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '10' then 
            offer_type_10_amt := offer_type_10_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '11' then 
            offer_type_11_amt := offer_type_11_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '12' then 
            offer_type_12_amt := offer_type_12_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '13' then 
            offer_type_13_amt := offer_type_13_amt + c1.MOFFERING_AMT;
     elsif  c1.SOFFERING_TYP = '14' then 
            offer_type_14_amt := offer_type_14_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '15' then 
            offer_type_15_amt := offer_type_15_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '16' then 
            offer_type_16_amt := offer_type_16_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '17' then 
            offer_type_17_amt := offer_type_17_amt + c1.MOFFERING_AMT;
    elsif  c1.SOFFERING_TYP = '18' then 
           offer_type_18_amt := offer_type_18_amt + c1.MOFFERING_AMT;
    else offer_type_18_amt := offer_type_18_amt + c1.MOFFERING_AMT;
    end if; 

END IF; 
end loop;

apply_yy:= substr(apply_yymmdd,1,4);

if weekly_amount != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES (  apply_yy  , 'IDON01WK99' ,  99,  weekly_amount , 'WEEKLY Total',    apply_yymmdd, IDETIAL_NO );
end if; 
if   offer_type_1_amt  != 0 then 
  INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES  (  apply_yy  , 'IDON01WK1' ,  1,  offer_type_1_amt , 'WEEKLY Tithes',    apply_yymmdd, IDETIAL_NO );
end if;
if   offer_type_2_amt != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK2' ,  2,   offer_type_2_amt , 'WEEKLY Thanks',    apply_yymmdd, IDETIAL_NO );
end if;
if   offer_type_3_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK3' ,  3,   offer_type_3_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_4_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK4' ,  4,   offer_type_4_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_5_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK5' ,  5,   offer_type_5_amt , 'WEEKLY SpecialFirm',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_6_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK6' ,  6,   offer_type_6_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_7_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK7' ,  7,   offer_type_7_amt , 'WEEKLY Steward',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_8_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK3' ,  8,   offer_type_8_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_9_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK9' ,  9,   offer_type_9_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_10_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK10' ,  10,   offer_type_10_amt , 'WEEKLY Retreat',    apply_yymmdd, IDETIAL_NO );
 end if;

if   offer_type_11_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK3' ,  11,   offer_type_11_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;
if   offer_type_12_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK12' ,  12,   offer_type_12_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

if   offer_type_13_amt  != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK, SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
         VALUES ( apply_yy, 'IDON01WK13' ,  13,   offer_type_13_amt , 'WEEKLY General',    apply_yymmdd, IDETIAL_NO );
end if;

 if  offer_type_14_amt != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK14' ,  14,   offer_type_14_amt , 'WEEKLY Five_Two',    apply_yymmdd, IDETIAL_NO );
end if;
if offer_type_15_amt != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK15' ,  15,   offer_type_15_amt , 'WEEKLY Post Offering',    apply_yymmdd, IDETIAL_NO );     
end if;
if offer_type_16_amt != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK16' ,  16,   offer_type_16_amt , 'WEEKLY EM',    apply_yymmdd, IDETIAL_NO );
end if;
if offer_type_17_amt != 0 then 
INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK17' ,  17,   offer_type_17_amt , 'WEEKLY Elder',    apply_yymmdd, IDETIAL_NO );
 end if;
 if offer_type_18_amt != 0 then 
 INSERT INTO TBLTRANSHISTORY 
      (IPROGRAMTYPE_SK,  SINCOME_PAYTYPE_ID,  SNATIVE_NM,  MTRANS_AMT, SDISCRIPTION,  IAPPLY_DT,  SEQUENCE_NO)
   VALUES   ( apply_yy, 'IDON01WK18' ,  18,   offer_type_18_amt , 'WEEKLY Thousand',    apply_yymmdd, IDETIAL_NO );
END IF;       

/*
    <td  align="center" 
          style="PADDING-BOTTOM: 0px; LINE-HEIGHT: 42px; PADDING-LEFT: 35px; PADDING-RIGHT: 
        10px; FONT-FAMILY:  Arial, Helvetica, sans-serif; COLOR: #0085c3; FONT-SIZE: 29px; PADDING-TOP: 0px" 
          class="style1">
               Weekly Auto Donation Created....</td> ' ;

*/
    commit;
    end;

No. Subject Author Date Views
66 Delete Message - Are you sure you want to delete this object? admin 2016.04.28 166
65 JAVA for delete admin 2016.04.28 162
64 SQL SELECT DISTINCT Statement admin 2016.04.29 161
63 INSERT PROCESS admin 2016.04.28 160
62 Using SQL*Plus to Unlock and Change Passwords admin 2023.06.04 159
61 DELETE PROCESS admin 2016.04.28 158
60 SQL Developer Password change / EXPORT & IMPORT admin 2022.03.18 157
59 wwv_flow_files admin 2016.05.01 155
58 MAX admin 2016.04.28 155
57 PHONE NUMBER admin 2016.04.28 153
56 Forgot Oracle username and password, how to retrieve? admin 2022.03.18 152
55 NVL admin 2016.05.19 152
54 CREATE (INSERT) PROCESS admin 2016.04.28 151
53 Field Showing admin 2016.04.01 149
52 Outer Join with Oracle SQL admin 2016.04.29 148
51 BOOLEAN SAMPLE admin 2016.05.11 147
50 COUNT admin 2016.04.28 146
49 Delimiter admin 2016.04.29 141
48 Column Data 일괄 추가 admin 2023.11.24 140
47 How to Update Oracle XE admin 2018.04.25 139