insert into ttl_assignments (user_id, ticket_id)
select user_id, :ticket_id
from ttl_area_assignments
where area_id = :area_id
select p.email
from parties p, ttl_assignments a
where a.ticket_id = :ticket_id and
a.user_id = p.party_id
select p1.first_names || ' ' || p1.last_name as ticket_creator_name,
p2.email as ticket_creator_email,
(select name from ttl_va_areas where area_id = :area_id) as area_name
from persons p1, parties p2
where p1.person_id = p2.party_id and
p1.person_id = :caller_id