Saturday, February 15, 2014

Query to Get Details from Catalog to Question

SELECT UPPER (hl.meaning) catalog_object_type,
       ocu.category_usage_id,
       ocu.category,
       oav.activity_version_id,
       oav.version_name course,
       oo.offering_id,
       oot.name offering_name,
       oe.event_id,
       oe.title class,
       oev.evaluation_id,
       olf.name folder_name,
       olo.learning_object_id,
       olo.name learning_objects,
       ot.test_id,
       ots.test_section_id,
       ots.name section_name,
       oqb.question_bank_id,
       oqb.name question_bank,
       oqb.start_date_active question_bank_active_date,
       oq.text question_text
  FROM ota_category_usages ocu,
       hr_lookups hl,
       ota_act_cat_inclusions oaci,
       ota_activity_versions oav,
       ota_offerings oo,
       ota_offerings_tl oot,
       ota_events oe,
       ota_evaluations oev,
       ota_lo_folders olf,
       ota_learning_objects olo,
       ota_tests ot,
       ota_test_sections ots,
       ota_question_banks oqb,
       ota_qbank_questions oqbq,
       ota_questions oq
 WHERE     ocu.business_group_id = :l_business_group_id
       AND hl.lookup_code = ocu.TYPE
       AND UPPER (hl.meaning) = 'CATEGORY'
       AND hl.lookup_type = 'CATEGORY_TYPE'       
       AND oaci.category_usage_id = ocu.category_usage_id
       AND oav.activity_version_id = oaci.activity_version_id
       AND oo.activity_version_id = oav.activity_version_id
       AND oot.offering_id = oo.offering_id
       AND oot.language = 'US'
       AND oe.activity_version_id = oav.activity_version_id
       AND oev.object_id = oe.event_id
       AND olo.test_id = oev.evaluation_id
       AND olo.folder_id = olf.folder_id
       AND ot.test_id = olo.test_id
       AND ots.test_id = ot.test_id
       AND oqb.folder_id = olf.folder_id
       AND oqbq.question_bank_id = oqb.question_bank_id

       AND oq.question_id = oqbq.question_id

No comments:

Post a Comment