select interval_id
from notification_intervals
where name = :name
select delivery_method_id
from notification_delivery_methods
where short_name = :name
select name,
interval_id,
n_seconds
from notification_intervals
where n_seconds>=0
order by n_seconds
select name,
notification_intervals.interval_id
from notification_intervals,
notification_types_intervals
where notification_intervals.interval_id = notification_types_intervals.interval_id
and type_id = :type_id
order by n_seconds
select pretty_name,
notification_delivery_methods.delivery_method_id
from notification_delivery_methods,
notification_types_del_methods
where notification_delivery_methods.delivery_method_id = notification_types_del_methods.delivery_method_id
and type_id = :type_id
order by pretty_name
select cc.user_id, interval_id, delivery_method_id, format
from notification_requests nr, cc_users cc
where type_id = :type_id
and nr.object_id = :object_id
and nr.user_id = cc.user_id
and cc.member_state = 'approved'
select user_id,
interval_id,
delivery_method_id
from notification_requests
where type_id = :type_id
and object_id = :object_id
delete
from notification_user_map
where notification_id = :notification_id
insert
into notification_user_map
(notification_id, user_id, sent_date)
select :notification_id, :user_id, current_timestamp
from dual where exists (select 1 from notifications
where notification_id = :notification_id)