111: Select 1 into type_exists
112: From Dual
113: Where Exists (
114: select 0
115: from pa_agreement_types atp, ra_terms rt
116: where atp.term_id = rt.term_id(+)
117: and trunc(sysdate) between trunc(atp.start_date_active)
118: and trunc(nvl(atp.end_date_active,sysdate))
119: and atp.agreement_type = p_agreement_type);