I have procedure as below i am trying to run from sql it give me error
SQL> execute financial_p(9,'2004');
BEGIN financial_p(9,'2004'); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'FINANCIAL_P' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Here is the procedure . which is similar to other one which is running fine.
CREATE OR REPLACE PROCEDURE Finacial_P (p_month number,p_year varchar2) IS
begin
declare
tmpVar NUMBER;
cosf number;
sga number;
common number;
branch_cd number;
curdate date;
v_end_date date;
--cursor gl is select * from temp_gl_bal;
--gl_bal gl%ROWTYPE;
BEGIN
--tmpVar := 0;
delete from Q_FUNC_RATIO_B_PARAM_IV;
delete from qa_results where plan_id = 112;
commit;
--curdate := TO_DATE(p_year || TO_CHAR(p_month,'fm00'),'R
RRRMM');
--v_end_date := LAST_DAY(TO_DATE(p_year || TO_CHAR(p_month,'fm00'),'R
RRRMM'));
curdate := '01' ||'-'|| to_char(p_month,'MON') ||p_year;
v_end_date := last_day(to_date(curdate,'
DD-MON-YYY
Y'));
delete from temp_gl_bal;
Commit;
if (p_month != 1) then
insert into temp_gl_bal
(
segment1,segment2,period_y
ear,period
_num,actua
l_flag,per
iod_net_dr
,period_ne
t_cr
)
(
select segment1,segment2,period_y
ear,period
_num,actua
l_flag,per
iod_net_dr
,period_ne
t_cr
from gl_code_combinations_kfv gcc,gl_balances gl
where gcc.code_combination_id = gl.code_combination_id
and set_of_books_id = 2
and actual_flag= 'A'
and period_year = p_year
and period_num = p_month
and substr(segment1,1,1) in ('5','6','7')
);
insert into temp_gl_bal
(
segment1,segment2,period_y
ear,period
_num,actua
l_flag,per
iod_net_dr
,period_ne
t_cr
)
(
select segment1,segment2,period_y
ear,period
_num,actua
l_flag,per
iod_net_dr
,period_ne
t_cr
from gl_code_combinations_kfv gcc,gl_balances gl
where gcc.code_combination_id = gl.code_combination_id
and set_of_books_id = 2
and actual_flag= 'B'
and period_year = p_year
and period_num between 1 and (p_month-1)
and substr(segment1,1,1) in ('5','6','7')
);
else
insert into temp_gl_bal
(
segment1,segment2,period_y
ear,period
_num,actua
l_flag,per
iod_net_dr
,period_ne
t_cr
)
(
select segment1,segment2,period_y
ear,period
_num,actua
l_flag,per
iod_net_dr
,period_ne
t_cr
from gl_code_combinations_kfv gcc,gl_balances gl
where gcc.code_combination_id = gl.code_combination_id
and set_of_books_id = 2
and actual_flag= 'A'
and period_year = p_year
and period_num = p_month
and substr(segment1,1,1) in ('5','6','7')
);
end if;
commit;
insert into Q_FUNC_RATIO_B_PARAM_IV
(
process_status,organizatio
n_code,pla
n_name,
branch_cd,cosf_ratio,sga_r
atio,commo
n_ratio,
date_opened,date_closed
)
(
select 1,'USA','FUNC RATIO B PARAM',SEGMENT2,cosf_ratio
,
case when (sum_of_csc-nvl(cosf,0))= 0 then '0'
else substr( (1-cosf_ratio*SGA/(sum_of_
csc-nvl(co
sf,0))
), 1,5)
end as SGA,
case when (sum_of_csc-nvl(cosf,0))= '0' OR (sum_of_csc - (nvl(cosf,0)+nvl(sga,0)))=
0 then '0'
else substr(abs((1-(cosf_ratio+
(1-cosf_ra
tio*SGA/(s
um_of_csc-
nvl(cosf,0
)))) *
COMMON / (sum_of_csc - (nvl(cosf,0)+nvl(sga,0)))
)),1,5)
end as COMMON,curdate,v_end_date
from (
select SEGMENT2, sum(COSF) as cosf, sum(SGA) as sga, sum(COMMON) as common,
-- sum of cosf, sga, and common
sum(cosf)+sum(sga)+sum(com
mon) as sum_of_csc,
case when nvl(sum(cosf),0) = 0 then 0
else
trunc(sum(cosf)/(sum(cosf)
+sum(sga)+
sum(common
)),4) end as cosf_ratio
from
(select SEGMENT1, SEGMENT2,
nvl(decode(substr(SEGMENT1
,1,1),'5',
nvl(PERIOD
_NET_DR-PE
RIOD_NET_C
R,0)),0) as cosf,
nvl(decode(substr(SEGMENT1
,1,1),'6',
nvl(PERIOD
_NET_DR-PE
RIOD_NET_C
R,0)),0) as sga,
nvl(decode(substr(SEGMENT1
,1,1),'7',
nvl(PERIOD
_NET_DR-PE
RIOD_NET_C
R,0)),0) as common
from temp_gl_bal
)
group by segment2
)
);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END ;
end;
/
Any clue...