postgresql7.1
insert into cu_user_curriculum_map
(user_id, curriculum_id, package_id)
select :user_id,
:curriculum_id,
:package_id
where not exists (select 1
from cu_user_curriculum_map
where user_id = :user_id
and curriculum_id = :curriculum_id)
select curriculum_id
from cu_curriculums
where package_id = :package_id
EXCEPT
select curriculum_id
from cu_user_curriculum_map
where user_id = :user_id
and package_id = :package_id