select
mp.organization_code,
qp.name plan_name,
qp.description plan_description,
xxen_util.meaning(qp.plan_type_code,'COLLECTION_PLAN_TYPE',3) plan_type,
xxen_util.meaning(to_char(qpt.transaction_number),'QA_TXN_NAME',700) transaction_name,
xxen_util.description(to_char(qpt.transaction_number),'QA_TXN_NAME',700) transaction_description,
xxen_util.yes(case when qpt.mandatory_collection_flag=1 then 'Y' end) mandatory_collection,
xxen_util.yes(case when qpt.background_collection_flag=1 then 'Y' end) background_collection,
xxen_util.yes(case when qpt.enabled_flag=1 then 'Y' end) enabled,
(select count(*) from qa_plan_transactions qpt2 where qpt.plan_id=qpt2.plan_id and qpt.transaction_number=qpt2.transaction_number) transaction_attachments,
qc.name collection_trigger,
(select qtct.form_description from qa_txn_collection_triggers qtct where qpt.transaction_number=qtct.transaction_number and qpct.collection_trigger_id=qtct.collection_trigger_id) trigger_field,
(select qtct.database_field from qa_txn_collection_triggers qtct where qpt.transaction_number=qtct.transaction_number and qpct.collection_trigger_id=qtct.collection_trigger_id) trigger_database_field,
xxen_util.meaning(qc.datatype,'QA_CHAR_DATATYPE',700) trigger_datatype,
xxen_util.meaning(qpct.operator,'QA_OPERATOR',700) trigger_operator,
qpct.low_value trigger_low_value,
qpct.high_value trigger_high_value,
xxen_util.user_name(nvl(qpct.created_by,qpt.created_by)) created_by,
xxen_util.client_time(nvl(qpct.creation_date,qpt.creation_date)) creation_date,
xxen_util.user_name(nvl(qpct.last_updated_by,qpt.last_updated_by)) last_updated_by,
xxen_util.client_time(nvl(qpct.last_update_date,qpt.last_update_date)) last_update_date
from
qa_plans qp,
mtl_parameters mp,
qa_plan_transactions qpt,
qa_plan_collection_triggers qpct,
qa_chars qc
where
qp.organization_id=mp.organization_id(+) and
qp.plan_id=qpt.plan_id and
qpt.plan_transaction_id=qpct.plan_transaction_id(+) and
qpct.collection_trigger_id=qc.char_id(+) and
(qp.organization_id=0 or qp.organization_id in (select oav.organization_id from org_access_view oav where oav.resp_application_id=fnd_global.resp_appl_id and oav.responsibility_id=fnd_global.resp_id)) and
1=1
order by
mp.organization_code,
qp.name,
transaction_name,
qpt.plan_transaction_id,
qc.name |