-- 1286
select count(*) from albpm602_lh.lh_activity_result ar where ar.activity_id like 'hu08x002x01PledgedDocCreation';
-- 9
select count(*) from albpm602_lh_eng.pprocinstance pi where pi.activityname like 'hu08x002x01PledgedDocCreation';
-- ZP
select * from
(select bc.business_case_id as pripad, docType.value dokument, docDelState.value stav
from albpm602_lh.lh_activity_result ar, albpm602_lh.lh_business_case bc,
albpm602_lh.lh_credit_product cp, albpm602_lh.lh_insurance_contract ic,
albpm602_lh.lh_ins_document ido,
(select code, value from albpm602_lh.cod_code cc, albpm602_lh.cod_code_value ccv
where cc.code_id = ccv.code_id
and cc.codetable_id =
(select ccd.codetable_id
from albpm602_lh.cod_codetable_def ccd
where lower(ccd.codetable_name) like 'lh_ins_docs_type')) docType,
(select code, value from albpm602_lh.cod_code cc, albpm602_lh.cod_code_value ccv
where cc.code_id = ccv.code_id
and cc.codetable_id =
(select ccd.codetable_id
from albpm602_lh.cod_codetable_def ccd
where lower(ccd.codetable_name) like 'lh_ins_docs_delivery_state')) docDelState
where ar.activity_id like 'hu08x002x01PledgedDocCreation'
and ar.request_id = bc.business_case_id
and bc.business_case_pk = cp.business_case_fk
and cp.credit_product_pk = ic.credit_product_fk
and ic.insurance_c
and ido.ins_document_type = docType.code
and ido.delivery_state_code = docDelState.code
union
select bc.business_case_id as pripad, docType.value dokument, docDelState.value stav
from albpm602_lh_eng.pprocinstance pi, albpm602_lh.lh_business_case bc,
albpm602_lh.lh_credit_product cp, albpm602_lh.lh_insurance_contract ic,
albpm602_lh.lh_ins_document ido,
(select code, value from albpm602_lh.cod_code cc, albpm602_lh.cod_code_value ccv
where cc.code_id = ccv.code_id
and cc.codetable_id =
(select ccd.codetable_id
from albpm602_lh.cod_codetable_def ccd
where lower(ccd.codetable_name) like 'lh_ins_docs_type')) docType,
(select code, value from albpm602_lh.cod_code cc, albpm602_lh.cod_code_value ccv
where cc.code_id = ccv.code_id
and cc.codetable_id =
(select ccd.codetable_id
from albpm602_lh.cod_codetable_def ccd
where lower(ccd.codetable_name) like 'lh_ins_docs_delivery_state')) docDelState
where pi.activityname like 'hu08x002x01PledgedDocCreation'
and pi.v_irequestid = bc.business_case_id
and bc.business_case_pk = cp.business_case_fk
and cp.credit_product_pk = ic.credit_product_fk
and ic.insurance_c
and ido.ins_document_type = docType.code
and ido.delivery_state_code = docDelState.code)
order by pripad;Add a code snippet to your website: www.paste.org