oracle8.1.6 select case when exists ( select 1 from application_group_element_map where package_id = :package_id and element_id = :party_id union all select 1 from application_groups where package_id = :package_id and group_id = :party_id ) then 1 else 0 end from dual select case when exists ( select 1 from application_group_element_map where package_id = :package_id and element_id = :party_id union all select 1 from application_groups where package_id = :package_id and group_id = :party_id ) then 1 else 0 end from dual select case when exists ( select 1 from application_group_element_map where package_id = :package_id and rel_id = :rel_id ) then 1 else 0 end from dual select case when exists ( select 1 from application_group_segments where package_id = :package_id and segment_id = :segment_id ) then 1 else 0 end from dual begin :1 := application_group.group_id_from_package_id ( package_id => :package_id, no_complain_p => :no_complain_p ); end; begin :1 := application_group.new ( group_id => :group_id, object_type => :group_type, group_name => :group_name, package_id => :package_id, context_id => :package_id, creation_user => :creation_user, creation_ip => :creation_ip, email => :email, url => :url ); end; begin application_group.del ( group_id => :group_id ); end;