[Home] [Help]
628: return;
629: else
630: select count(*)
631: into v_active_record_count
632: from JTF_UM_SUBSCRIPTION_TMPL
633: where SUBSCRIPTION_ID = JTF_UMUTIL.subscription_lookup(x_subscription_key, to_date(x_subscription_key_start_date,'YYYY/MM/DD HH24:MI:SS'))
634: and EFFECTIVE_END_DATE is NULL
635: and LAST_UPDATED_BY <> 1;
636:
639: end if;
640:
641: select LAST_UPDATED_BY
642: into v_db_owner_id
643: from JTF_UM_SUBSCRIPTION_TMPL
644: where SUBSCRIPTION_ID = JTF_UMUTIL.subscription_lookup(x_subscription_key, to_date(x_subscription_key_start_date,'YYYY/MM/DD HH24:MI:SS'))
645: and TEMPLATE_ID = JTF_UMUTIL.template_lookup(x_template_key, to_date(x_template_key_start_date,'YYYY/MM/DD HH24:MI:SS'))
646: and EFFECTIVE_START_DATE = to_date(x_effective_start_date, 'YYYY/MM/DD HH24:MI:SS');
647:
660:
661: exception
662: when no_data_found then
663:
664: update JTF_UM_SUBSCRIPTION_TMPL
665: set EFFECTIVE_END_DATE = SYSDATE
666: where EFFECTIVE_END_DATE is NULL
667: and SUBSCRIPTION_ID = JTF_UMUTIL.subscription_lookup(x_subscription_key, to_date(x_subscription_key_start_date,'YYYY/MM/DD HH24:MI:SS'));
668: