update acs_objects set context_id = (select package_id from dotlrn_community_applets where community_id = :selected_community and applet_id = ( select applet_id from dotlrn_applets where applet_key = 'dotlrn_faq' )) where object_id = :object_id SELECT b.object_id as package_id FROM acs_objects as a,acs_objects as b WHERE a.context_id=:selected_community and a.object_type='apm_package' and a.object_id=b.context_id and b.title='FAQ'; SELECT faq_name,separate_p FROM faqs WHERE faq_id=:object_id; SELECT question,answer FROM faq_q_and_as WHERE faq_id=:object_id; select faq__new_q_and_a ( :entry_id, :faq_id, :one_question, :one_answer, :sort_key, 'faq_q_and_a', now(), :user_id, :creation_ip, :faq_id ); select faq__new_faq (:faq_id, :faq_name,:separate_p,'faq', now(), :user_id,:creation_ip,:package_id);