Problem in PL/SQL and CR
577838Mar 1 2010 — edited Mar 1 2010Hi , i am trying to publish a report by CR i make my report on my system and run it successfull but when i published my report or reporting server then i face the following problem
Error in File C:\Business Objects\BusinessObjects Enterprise 11\Data\procSched\CIS03.reportjobserver\~tmp1a6c60b61dde8b81.rpt: Database Connector Error
this problem is solved when i removed the IF condition from my query but with IF condition i am facing the same problem. I am not facing this problem when i have this on my hand but only after pulishing so please help me if any one can following is the procedure in which i am facing the problem
create or replace
PROCEDURE cm_discon_fld_activity (
p_rep_cursor IN OUT cisadm.cr_package.cr_rpt_type,
prm_unit IN cisadm.ci_char_val.char_val%TYPE,
prm_fa_status IN cisadm.ci_fa.fa_status_flg%TYPE,
prm_fa_type_cd IN cisadm.ci_fa.fa_type_cd%TYPE,
prm_zone IN cisadm.ci_char_val_l.descr%TYPE,
prm_date_from IN cisadm.ci_fa.cre_dttm%TYPE,
prm_date_to IN cisadm.ci_fa.cre_dttm%TYPE
)
AS
BEGIN
IF TRIM (prm_fa_status) = 'C' THEN
OPEN p_rep_cursor FOR
select sa.acct_id, pn.entity_name,
(SELECT char_val
FROM cisadm.ci_prem_char
WHERE prem_id = sa.char_prem_id
AND char_type_cd = 'UNIT'
AND TRIM (char_val) = NVL (prm_unit, TRIM (char_val))and rownum=1) unit,
(SELECT descr
FROM cisadm.ci_prem_char pc, cisadm.ci_char_val_l cvl
WHERE pc.char_type_cd = cvl.char_type_cd
AND pc.char_val = cvl.char_val
AND prem_id = sa.char_prem_id
AND cvl.char_type_cd = 'ZONE'
AND descr = NVL (TRIM (prm_zone), TRIM (descr))and rownum=1) zzone,
fa.cre_dttm,fa.fa_type_cd,fa.fa_status_flg,
--(select work_dttm from ci_fa_stage_up where fa_id=fa.fa_id) dt_of_work,
READ_DTTM dt_of_work ,
fa.fa_id,fa.disp_grp_cd,dgl.descr,
(select sum(cur_amt) from ci_ft where sa_id in (select sa_id from ci_sa where acct_id=sa.acct_id)) os_amt
from ci_fa fa,ci_sp sp,ci_sa sa,ci_acct_per ap,ci_per_name pn,ci_disp_grp_l dgl, ci_mr_stage_up msp, ci_sp_mtr_hist smph , ci_sp spp
where --fa.cre_dttm between '01-Jan-2009' and '02-Jan-2009'
READ_DTTM BETWEEN prm_date_from /*'01-JAN-2009'*/ AND prm_date_to
/*'02-JAN-2009'*/--between '16-Feb-2010' and '17-Feb-2010'
and TRIM (fa.fa_type_cd) = upper ( prm_fa_type_cd)--in ('G-LOCK','G-UNLOCK','SG-LOCK','SM-REMVL','M-REMVL')
AND TRIM ( fa.fa_status_flg ) = 'C'
and fa.sp_id=sp.sp_id
and sp.prem_id=sa.char_prem_id
and sa.sa_type_cd like 'U-%'
and sa.SA_STATUS_FLG = '20'
AND USE_ON_BILL_SW = 'Y'
and sa.acct_id=ap.acct_id
and ap.per_id=pn.per_id
and msp.MTR_CONFIG_ID= smph.MTR_CONFIG_ID
and smph.sp_id = spP.sp_id
AND SPP.SP_ID = SP.SP_ID
AND smph.REMOVAL_DTTM IS NULL
and pn.PRIM_NAME_SW='Y'
and fa.disp_grp_cd=dgl.disp_grp_cd;
--AND SA.ACCT_ID = '9739021000';
END IF ;
--ELSE
IF TRIM (prm_fa_status) != 'C' THEN
OPEN p_rep_cursor FOR
SELECT sa.acct_id, pn.entity_name,
(SELECT char_val
FROM cisadm.ci_prem_char
WHERE prem_id = sa.char_prem_id
AND char_type_cd = 'UNIT'
AND TRIM (char_val) = NVL (prm_unit, TRIM (char_val))and rownum=1) unit,
(SELECT descr
FROM cisadm.ci_prem_char pc, cisadm.ci_char_val_l cvl
WHERE pc.char_type_cd = cvl.char_type_cd
AND pc.char_val = cvl.char_val
AND prem_id = sa.char_prem_id
AND cvl.char_type_cd = 'ZONE'
AND descr = NVL (TRIM (prm_zone), TRIM (descr))and rownum=1) zzone,
fa.cre_dttm, fa.fa_type_cd, fa.fa_status_flg,
(SELECT work_dttm
FROM cisadm.ci_fa_stage_up
WHERE fa_id = fa.fa_id) dt_of_work, fa.fa_id, fa.disp_grp_cd,
dgl.descr, (SELECT SUM (cur_amt)
FROM cisadm.ci_ft
WHERE sa_id IN (SELECT sa_id
FROM cisadm.ci_sa
WHERE acct_id = sa.acct_id))
os_amt
FROM cisadm.ci_fa fa,
cisadm.ci_sp sp,
cisadm.ci_sa sa,
cisadm.ci_acct_per ap,
cisadm.ci_per_name pn,
cisadm.ci_disp_grp_l dgl
WHERE fa.cre_dttm BETWEEN prm_date_from /*'01-JAN-2009'*/ AND prm_date_to
/*'02-JAN-2009'*/
AND TRIM (fa.fa_type_cd) IN NVL
( upper(prm_fa_type_cd), TRIM (fa.fa_type_cd))
-- ('G-LOCK','G-UNLOCK','SG-LOCK','SM-REMVL','M-REMVL')
AND TRIM (fa.fa_status_flg) = prm_fa_status
--AND TRIM (fa.fa_status_flg) != 'C'
AND fa.sp_id = sp.sp_id
AND sp.prem_id = sa.char_prem_id
AND sa.sa_type_cd LIKE 'U-%'
and sa.SA_STATUS_FLG = '20'
--AND USE_ON_BILL_SW = 'Y'
AND sa.acct_id = ap.acct_id
AND ap.per_id = pn.per_id
AND pn.prim_name_sw = 'Y'
AND fa.disp_grp_cd = dgl.disp_grp_cd;
END IF ;
END cm_discon_fld_activity;
I am facing the same problem in every report in which i use IF condition can any one help me i am using CR XI Business Object