515:
516: END install_tax_rules;
517:
518: --****************************************************************************
519: -- INSTALLATION PROCEDURE FOR : PAY_WC_STATE_SURCHARGES
520: --****************************************************************************
521:
522: PROCEDURE install_surcharges(p_phase IN number)
523: -----------------------------------------------
583: into l_new_surrogate_key
584: , l_add_to_rt
585: , l_rate
586: , l_name
587: from pay_wc_state_surcharges
588: where state_code = stu_rec.state_code
589: and position = stu_rec.position;
590:
591: IF stu_rec.add_to_rt = l_add_to_rt AND
605: EXCEPTION WHEN NO_DATA_FOUND THEN
606:
607: -- Must be a new surcharge
608:
609: select pay_wc_state_surcharges_s.nextval
610: into l_new_surrogate_key
611: from dual;
612:
613: END;
640: END IF;
641:
642: -- Attempt update first
643:
644: update pay_wc_state_surcharges
645: set SURCHARGE_ID = stu_rec.SURCHARGE_ID
646: , STATE_CODE = stu_rec.STATE_CODE
647: , ADD_TO_RT = stu_rec.ADD_TO_RT
648: , NAME = stu_rec.NAME
659:
660: -- Row does not exist so insert
661:
662:
663: insert into pay_wc_state_surcharges
664: (SURCHARGE_ID
665: ,STATE_CODE
666: ,ADD_TO_RT
667: ,NAME
673: ,CREATED_BY
674: ,CREATION_DATE
675: )
676: values
677: (pay_wc_state_surcharges_s.nextval -- changes for nextval
678: ,stu_rec.STATE_CODE
679: ,stu_rec.ADD_TO_RT
680: ,stu_rec.NAME
681: ,stu_rec.POSITION